Hello all, I am having issues doing 301 redirects after rewriting URLs. It adds queries at the end of the URL after redirecting. http://www.thedomain.com/about/sitemap.php should 301 redirect to: http://www.thedomain.com/site-map.html but it redirects to: http://www.thedomain.com/site-map.html?page=about/sitemap.php and gives a 404 This is the .htaccess code: -------------------------------------------- RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.thedomain\.com [NC] RewriteRule ^(.*)$ http://www.thedomain.com/$1 [R=301,L] #Rewrites page.shtml as index.php?page RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_FILENAME} !-d [NC] RewriteRule ^(.+)$ index.php?page=$1 [QSA] #301 map for new CMS site redirect 301 /about/sitemap.php http://www.thedomain.com/site-map.html -------------------------------------------- Any ideas?
#301 map for new CMS site RedirectPermanent /about/sitemap.php http://www.thedomain.com/site-map.html
this is not working either: RedirectMatch permanent ^/about/sitemap\.php$ http://www.thedomain.com/site-map.html
Took me all day, but I figured it out! I had to use RewriteRule to make it work: ----------------------------------------------- RewriteEngine On RewriteBase / RewriteRule ^about/sitemap\.php$ site-map.html [R=301,L] [add as many 301 redirect as you want here] RewriteCond %{HTTP_HOST} !^www\.thedomain\.com [NC] RewriteRule ^(.*)$ http://www.thedomain.com/$1 [R=301,L] #Rewrites page.shtml as index.php?page RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_FILENAME} !-d [NC] RewriteRule ^(.+)$ index.php?page=$1 [QSA] ----------------------------------------------- Hope this post helps someone out. Cheers