Create the code to catch any deleted pages and 301 the traffic to my home page. This is for a 5 page website that used to have 100's of pages.
The new site is small, the old was huge.
Currently this function is done by a wordpress-plugin.
## Deliverables
You are welcome to contact the author of the plugin below that currently does all this function. I need a version for a small static HTML site, not Wordpress.
This plugin catches any stray links, from changed or any deleted pages and connects them to the index page.
I'm looking for the same thing for a static html site.
I plan to use this code on any site were I delete pages.
---------------------------------------------------------------------------------------------
#### : [Daniel Fruzynski][1]
As you probably know, incoming links play important role in ranking well in Google and other search engines. Therefore you should assure that every incoming link leads to one of pages on your blog. This may be a challenge, because World Wide Web is dynamic and changes every day:
* you can remove some posts or pages on your blog;
* you can change URL scheme on whole blog;
* incoming links may became broken (e.g. due to some automatic text formatting);
* someone may simply put wrong (broken) link somewhere.
All of the above leads to link juice waste. You can avoid this by using this plugin. It redirects all non-existing URLs which normally return a 404 error to the blog front page using 301 (permanent) redirect. This way everyone who comes to your blog via broken link (both people and robots) will be redirected to the front page.
The only one exception are files in root blog directory with names starting with `noexist_`. They are used by Google to verify page in Google Webmasters Tools, so Link Juice Keeper does not redirect them.