Forum Moderators: phranque
I have some old pages showing up as supplemental results, these pages no longer exist but if you click on a link to say index.php?cat=oldpage index.php will be displayed, this could get the site a duplicate content so I've been playing with mod_rewrite and 301 redirects to get rid of the problem without success, at the moment I'm using;
RewriteRule ^index\.php?cat=oldpage$ /different-url.html [R=301,L]
Which doesn't work, I also tried;
redirect 301 /index.php?cat=oldpage ht#p://w#w.domain-name.com/different-url.html
Unfortunately its not working, I've done a test that worked fine with;
RewriteRule ^nonexistent_file\.html$ /different-url.html [R=301,L]
So my guess is that its something to do with .php?cat=### , any ideas would be appreciated.
Thanks for the pointer, in the end I used;
rewritecond %{query_string} ^cat=oldpage
rewritecond %{HTTP_HOST} ^(.*)$
RewriteRule ^(.*)$ [%1...] [R=301,L]