[thelist] Apachache mod_rewrite [Solved]

Hershel Robinson hershelr at netvision.net.il
Thu Sep 15 01:46:08 CDT 2005


> RewriteRule /features/([0-9]+) /features.php?mag=$1
> RewriteRule ^/features/([0-9]+) /features.php?mag=$1
> RewriteRule ^features/([0-9]+) /features.php?mag=$1

The full code in .htaccess needs to be this:

RewriteEngine on
RewriteBase /
RewriteRule ^features/([0-9]+) features.php?mag=$1

and of course something VERY important is this:
AllowOverride All

or at least not:
AllowOverride None

(which is the default) in httpd.conf.

<tip type="Windows Apache 2.0 mod_rewrite" author="Hershel Robinson">
First thing one must not forget is to have this:

AllowOverride All

or at least not:
AllowOverride None

(which is the default) in httpd.conf.

Next thing is you may well need these two lines in the .htaccess of the 
directory in question:

RewriteEngine on
RewriteBase /

After that you can add your rules.

YMMV, but mine wouldn't work without the above.
</tip>


More information about the thelist mailing list