which is the correct way to redirect customers to the home page, incase the page they are looking for is deleted or moved. for example there is a page http://example.com/example.html but this page is deleted or its moved, now visitors come from search engines but they dont find the page, same happens to the search engines when they crawl the site. so to avoid losing visitors and also search engines whats the correct way to redirect users to the home page when they dont find the page they are looking for.
Deleted Page If visitors cannot find the deleted page after clicking on a dead link, you must display a customized "Page Not Found" page with hints on how to locate what they are looking for. It can contain related links and a search form. Moved Page Do a 301 redirect pointing to the new page and to tell search engines that if they come across that page when indexing, they'll be notified a new page replaced that old one.
Yeah. You can also use a 302 if you think that you will put content up in that place later. This will maintain the page position for while as you create the new page content.
i think 301 would be ok for me coz i want the search engines and vistors to go to the home page if they dont find the page. now how to i setup the 301 redirect is there a code or something i need to put?