Question

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!

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top