Google Site Verification Problem Using Custom Error Pages

Posted on October 11, 2007
Filed Under Google, Webmaster Tools |

On most of our websites we use custom error pages, this enables a user requesting a page that does not exist on our server to be redirected to another page on our server that does exist. The final page they land at has text saying something like “Oops! The page you are looking for no longer exists, please go back to our home page and start again.” We will alos provide a link back to our home page within this text.

The benefit of this is that users who may encounter a page not found problem will (most of the time) follow the link provided and stay on the site rather than leave. Think about how many times you have found the 404 page not found error and just gone elsewhere. At most you will probably refresh the page once, but if you get the error again you will move on (unless you absolutely must get to the site in question, in which case you may remove the filename and request the top level instead).

Anyway, I have been trying to verify the website in question using my Google Webmaster Tools account. This process involves uploading a page created by Google to my server and then requesting verification from inside my Google account. Unfortunately, this failed because of the custom error page returning a 200 (success) code in the header. This custom error page is defined in the htaccess file thus:

ErrorDocument 404 http://www.domainname.com/errorpage.htm

In order to verify the website I removed this line of code from the htaccess file and uploaded it to the server. I then requested verification, which was successful, and reverted the htaccess file back to its original condition, which the include the line ErrorDocument 404 http://www.domainname.com/errorpage.htm and uploaded it back to the server.

The alternative to this method was adding a meta tag to my home page, which would have been just as easy to do…

The final result is the site is verified and I still have my custom error page.


Comments

Leave a Reply