.htaccess rewriting certain word in url

Go To StackoverFlow.com

0

I cannot seem to find the answer to this

I am looking for a .htaccess rewrite way to turn this url

http://www.mydomain.com/Virtuemart.html?keyword=adobe&page=shop.browse

to

http://www.mydomain.com/virtuemart.html?keyword=adobe&page=shop.browse

So basically i just want to change the capital V

There are many pages and variables after the ? so doing it one by one is almost impossible

is their an easy way to do this.

Many thanks for your time

David

2012-04-04 17:40
by David Walker


0

Using mod_rewrite (under apache), you can stick something like this in the .htaccess file in your document root:

RewriteEngine On
RewriteRule ^Virtuemart.html /virtuemart.html [L,QSA]

The query string just gets appended to the end untouched. If you want to redirect the browser, add a R=301 flag to the end (or just R if you don't want 301). This makes it so when someone goes to http://www.mydomain.com/Virtuemart.html, they'd actually get served the page at /virtuemart.html.

2012-04-04 18:04
by Jon Lin
Thanks for that, added the following to the .htaccess file but when i click on a Virtuemart.html?= link in google it still goes to an error page, so not rewritting to the new virtuemart RewriteRule ^Virtuemart.html /virtuemart.html [L,QSA,R=301 - David Walker 2012-04-05 07:50
Ads