I am trying to redirect [via .htaccess] all the URLs in my forum which will contain this, mode=linear Example URL: forums/showthread.php?mode=linear&tid=800&pid=1901 I want to redirect all URLs that will have "mode=linear" in it to a 404 not found page. The reason is that this mode thing create duplication problem. Can someone help?
Does it have to be a 404, what about doing a 301 to the non-linear instead ? Something like this for starters, I'm not sure what the potential querystrings will look like, but based on what you posted this would do the trick. RewriteCond %{QUERY_STRING} ^mode=linear&tid=([0-9]+)&pid=([0-9]+)$ RewriteRule showthread\.php$ showthread.php?tid=%1&pid=%2 [R=301] Code (markup):