I have a site which uses mod_rewrite for rewriting pages to SEO freindly url's, like:
http://www.example.com/details.php?id=myid
to
http://www.example.com/myid-page.html
now the problem is somehow the first page with query string got indexed in google and I want to now do 301 permanent redirect on above page to .html page.
But when I try to use, I get following problems:
- "Redirect 301" does not works because it has a query string
- RewriteRule with RewriteCond takes it in a loop, given below the rule I am using:
RewriteCond %{QUERY_STRING} ^id=myid$
RewriteRule ^/details\.php http://www.example.com/myid-page.html? [R=301,L]
Can any one suggest how to avoid user typing urls with querystring, which should auto redirect to the HTML version?