Page 1 of 1

Mod Rewrite doesn't seem to be active

Posted: Sat Mar 15, 2008 1:44 pm
by impulse()
It's enabled on Apache and phpinfo() show's the module is loaded. My .htaccess file looks like this:
RewriteEngine on
RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1
I have also run 'chmod 777 .htaccess' to make sure it's not a permissions problem. But when I go to products.php?id=12 the URL shows exactly that and doesn't seem to rewrite. I've followed a few tutorials on mod_rewrite and nothing suggests anything to fix this problem. Can you see a reason for this with the information I have provided?

Thanks,

Re: Mod Rewrite doesn't seem to be active

Posted: Sat Mar 15, 2008 3:24 pm
by Christopher
According to your rule it would rewrite "product12.html" to "product.php?id=12". I would also not that your are adding an "s" to "product" in your example.

Re: Mod Rewrite doesn't seem to be active

Posted: Tue Mar 18, 2008 5:08 am
by devendra-m
RewriteEngine on
RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1
you have used dash(-) after product

Re: Mod Rewrite doesn't seem to be active

Posted: Tue Mar 18, 2008 1:57 pm
by impulse()
I thought I'd try mod_rewrite at the most basic level and here are my results.

I have a .htaccess file with the following in it:
RewriteEngine on
RewriteRule old.html new.html
And I have both old.html and new.html in the same directory. But no matter which one I goto, it shows the content of the one I've gone to. Am I missing something about mod_rewrite or does it not seem to be active from the above example?