i moved from an old script to a new script and many of the old pages are backlinked and indexed in google.. the old script is GONE so i need to redirect anything that comes into the website from these old links to the home page. an example of an old page - www.website.com/show.php?show=single&id=2156. there may be hundreds of these that all start with www.website.com/show.php? how do i redirect them all to the home page without having to list every one of them in my htaccess file.
You can use http://htaccessredirect.net/index.php This site will create the code that you can paste in .htaccess file Let me know if this help. Otherwise i will provide you the exact code.
nice site but it doesn't help me with 'wildcarding' files.. for example there are hundreds of files that start with '/show.php?' and i'd like to redirect them all to one page..
To redirect all such links to your home page you can add this to your .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ^ RewriteRule ^show\.php$ /? [L,R=301] redirect 301 /show.php http://www.website.com/ Code (markup): Lines 1-2 you don't need if you already have those in your .htaccess file, so make sure to check that first. Lines 3-4 take all queries on your show.php script and 301 redirect all to / (your site index) and cut off queries. Line 5 redirects all direct hits to show.php without queries to your index page. Cheers.