Custom 404 Error Pages and Broken Links
Are 404 errors in your log files / analytics program bad? What should you do if you have a page that Google keeps visiting, which doesn’t exist? Should you block Google from that page in the robots.txt file? Should you create a page for that URL just so you have something up when Google visits? Why do they keep coming back? Is there a link on your site or some other site pointing to that URL? If so, how can you find out where the link is so you can delete or change it? Should you create a custom 404 error page that returns a 200 status code too fool the search engine into thinking the page is actually there?
We all know that 404 errors are a bad thing. Pain is a bad thing too. But remember that movie quote “Pain is your friend because it lets you know you’re still alive”? Or when a doctor tells you that pain killers are bad because they keep your body from telling you something is wrong? In the same way, 404 error pages are a good because they return a 404 error status code to your server logs, and to the search engines. This lets everyone know that something is wrong. Something is broken. Something needs to be fixed. So to answer one of the questions above - NO, you do not want your error “page not found” pages, customized or not, to return a 200 status code. For one thing, 200 status codes on 404 pages will keep you from being able to verify your site using Google Webmaster Tools, which is like giving up a whole sweet set of free SEO tools and metrics.
So now that we know that pain is a good thing because it lets you know what needs to be fixed, you may ask: OK, so how do I fix it? Let’s take a moment and think about this. If a search engine is hitting this page over and over, there is probably a link (or links) to it somewhere, and it has to be indexed. Any page that has a link into it is counting toward the overall link popularity of your site, so you want to leverage that. Blocking that page in the robots.txt file is doing exactly the opposite. Instead, what you want to do is apply a 301 redirect to that URL and send them to another page, preferably one for which you want more link popularity. But you can never go wrong with sending them to your home page.
The process of redirecting a URL via a 301 permanent redirect varies depending on how your site is set up and what kind of server platform you are using. In a typical Linux-Apache-MySQL-PHP (LAMP) environment, one line of code the .htacess file should do it. Some hosts will hide this system file, so you may need to go to “preferences” in your Cpanel and “show hidden files” or “show system files”. If all else fails, just get tech support on the phone and have them help you out. If you are on a Windows IIS server, you may want to invest in a little program called ISAPI.
Here is an example of what you would put into an .htaccess file on an Apache/Linux server to redirect a page:
redirect 301 /old-file-name.htm http://www.yoursite.com/new-file-name.htm
Here is an example of what you would put into httpd.ini file for a Windows/IIS server to redirect a page:
RewriteRule /old-page.asp http://www.example.com/new-page.asp [I,O,RP,L]
I hope this helps. The entry was going to be longer, but my wife wants me to go with her to look at a new rabbit she wants. ![]()



Old Mr. Sizemore
Black Everett
Manga Me!
Drunk Everett






