Web Hosting Talk







View Full Version : Rewrite problem


Skeptical
02-01-2010, 06:47 AM
I am having problem with mod rewrite and am completely stumped and wondering if anyone out there can help me.

The goal here is this. When I open up this URL:

http://toplaser.serverpro5.com/virtuemart/category/3/e-light-rejuvenation-system.html?Itemid=91

I want "Itemid=91" to be transformed to "Itemid=90", like this:

http://toplaser.serverpro5.com/virtuemart/category/3/e-light-rejuvenation-system.html?Itemid=90


I wrote the following in .htaccess but it isn't working:

RewriteRule Itemid=91 Itemid=90

Does anyone know how to get this working?

thinkovi
02-01-2010, 08:40 AM
Try something like this

RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)virtuemart/category/3/e-light-rejuvenation-system.html$
RewriteCond %{QUERY_STRING} Itemid=91
RewriteRule ^(.*)$ http://toplaser.serverpro5.com/virtuemart/category/3/e-light-rejuvenation-system.html?Itemid=90

Dr:linux
02-04-2010, 02:19 AM
Just try this

# vi .htaccess

and just add the following

RewriteEngine On

RewriteRule ^(virtuemart/category/3/e-light-rejuvenation-system.html?Itemid=91) virtuemart/category/3/e-light-rejuvenation-system.html?Itemid=90 [R]

Please let me know if you need any assistance.