I thied hard to google this one but didn't get the right solution (at least not one that would not give me 500 error back) I am shutting down a site and I would like all the pages that ever existed on that site to redirect to main index page (mydomain.com/index.html) Can someone help me? thanks, reps will be given!
I would advise you to use .htaccess 301 redirection, this will also avoid any search engines to penalize you for it. The 301 redirect tells the browser that the page has been moved. To implement this here is the details: 1.Create a file on the root directory of your website, name it ".htaccess". 2.Open the .htaccess file using notepad or what ever text editor that you prefer. 3.Add this into the .htaccess file, save it and then upload it to your web server: Redirect 301 /old/old.html http://www.you.com/new.html you can check the following link for more information: http://www.stevenhargrove.com/redirect-web-pages/
you should be able to redirect the whole directory, if your site was in /old/ then you remove the old.html. you can also do permanent directions from your hosts control panel. which panel software does your hosting use? Cpanel?
OK, I found the solution. I have simply redirected all 404 pages to main index.html Here is what I have put in .htaccess: ErrorDocument 404 /index.html