3

I have cleaned up my site and discarded lots of pages. I have now 10pages left of a 100page site, all static html. I want any request for deleted pages to 301 redirect to homepage but can't figure out the .htaccess rules!

Tutul
  • 726
  • 8
  • 15

2 Answers2

3

I doubt there's a better way than listing out the 90 pages manually in your .htaccess:

redirect 301 /somedeletedpage.htm http://www.example.com/

unless the 90 removed pages have some common characteristics that can be regexed.

Dominic Rodger
  • 97,747
  • 36
  • 197
  • 212
2

you don't want to 301 it, that would be an incorrect code, as those missing pages have not been moved to the location of your main page. You should be serving a 404 or a 410. You could use a custom 404 so your users could have some links to the pages that are there now.

  • Won't that be bad for search engine ranking? – Tutul Oct 26 '09 at 15:44
  • @Tutul - no, if anything it'll be better for search engine rankings, especially 410 - since that is the correct response (the content has *gone*). – Dominic Rodger Oct 26 '09 at 15:50
  • as Dominic said, this is better, 301 everything to your main page could be an seo nightmare, though reducing from 100 to 10 is a bit odd as well but that is outside the scope of this question. –  Oct 26 '09 at 16:36