As Google states “Google Sitemaps is an easy way for you to submit all your URLs to the Google index and obtain detailed reports about the visibility of your pages on Google”

This is obviously a significant advantage for a webmaster running a search engine optimiation program on their site. Information direct from Google on how the site has been crawled and where the problems are.

Unfortunately for you to access the full information Google needs to verify that you are the operator of the site and this is not always easy although there is a simple solution.

Sometimes you will receive a message “We’ve detected that your 404 (file not found) error page returns a status of 200 (OK) in the header.

This configuration presents a security risk for site verification and therefore, we can’t verify your site. If your web server is configured to return a status of 200 in the header of 404 pages, and we enabled you to verify your site with this configuration, others would be able to take advantage of this and verify your site as well. This would allow others to see your site statistics. To ensure that no one can take advantage of this configuration to view statistics to sites they don’t own, we only verify sites that return a status of 404 in the header of 404 pages. Please modify your web server configuration to return a status of 404 in the header of 404 pages. Note that we do a HEAD request (and not a GET request) when we check for this. Once your web server is configured correctly, try to verify the site again. If your web server is configured this way and you receive this error, click Check Status again and we’ll recheck your configuration.”

I have read many complex solutions suggested to overcome this problem, many involving changing code in the website or changing the way the server handles errors whereas there could be a simpler way.

Google is looking for the following response from your server

1. It can find the file it asked you to store in your site

2. It gets a 404 error when it searches for a file which does not exist

Often sites are set up to gracefully handle requests for pages that do not exist with a custom error page. and this handicaps the verification process I am assuming that if this is the situation for your site you have tried to disable this 404 error page for a while whilst you verify the site.

So to move to the solution….

Verification takes two seconds so why not take out the redirection rules on your site for two seconds?

Please note – Only try this if you are comfortable working in your root directory

1. log into Google Sitemaps and navigate to the verification page for your site

2. Check that your site has the file Google has asked you to save in the right directory

3. Rename your .htaccess file to .myhtaccess

4. Immediately press the verify button on the sitemaps account

5. It will then confirm verification is successful

6. Rename your .myhtaccess file to .htaccess

7. Check your site works ok

8. Sit down to watch the TV and relax

This seems a more simple solution that rewriting php code in your site.