301 redirect in .htaccess from query string to pretty url
Posted: Mon Jul 05, 2010 1:08 pm
Hi there,
I'm not sure if I've posted this in the correct place, but here goes...
I'm trying to apply a series of 301 redirects from a clients current site to the new cmsms site which uses pretty urls.
Normal redirects work fine i.e
However, I'm having trouble redirecting a pages with a query string,
i.e page.php?id=2 to page.html
I have tried:
This however doesn't work. The htaccess I'm using is the one out of the doc folder from the cmsms install. Do you think there's maybe a conflict between code that already exists in this file, i.e:
Thanks in advance
I'm not sure if I've posted this in the correct place, but here goes...
I'm trying to apply a series of 301 redirects from a clients current site to the new cmsms site which uses pretty urls.
Normal redirects work fine i.e
Code: Select all
RewriteRule ^page\.php$ http://www.website.com/page.html [R=301,L]
i.e page.php?id=2 to page.html
I have tried:
Code: Select all
RewriteCond %{QUERY_STRING} id=([0-9]+)
RewriteRule ^vpage.php$ %page.html? [R=302,L]
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]