Jump to content

Having trouble getting RewriteRule to work with root directory


Recommended Posts

I have the following RewriteRule working within an htaccess file in the root directory of a site:

<IfModule mod_rewrite.c> 
Options FollowSymLinks
RewriteEngine on
RewriteRule ^direct/(.+) /index.php?q=$1 [L]
</IfModule>

 

I'm trying to get it to work without the need to reference the directory "direct" on the first part of the rule and instead reference the root:

RewriteRule (.+) /index.php?q=$1 [L]

 

For some reason it's not working as expected.  I know that if you're referencing the folder in which htaccess resides then you don't need the leading "/".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.