Dmitry Makovetskiyd
Dmitry Makovetskiyd

Reputation: 7053

Fail to enable mod_rewrite on my apache server

This is how my apache httpd file looks like:

LoadModule rewrite_module modules/mod_rewrite.so

<Directory / >
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
allow from all
</Directory>

Now i try to execute this simple mod rule:

RewriteEngine on

RewriteRule ^product-([0-9]+)\.html$ index.php?id=$1

This rewrite should happen when i press this link:

 <a href="product-91.html">Press me</a>

Upvotes: 0

Views: 188

Answers (1)

bengert
bengert

Reputation: 36

if you put your rewrite rule in the apache config you will need a leading / after the ^(not needed for htaccess). Try the rule with out ^ to see if it matches. I have also had some servers/vhosts where I needed to add RewriteBase rewrite would work.

Upvotes: 1

Related Questions