x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Google Sitemaps continued

To get your sitemap verified - which is a 1x process - the Google protocol says you need to put a file entitled googlexyzetc.html or googlexyzetc.htm at the root level. Google will tell you how to name the file. “xyzetc.” is just a placeholder. Trust me when I tell you it will be a hideously long string they give you to uniquely identify your site.

The problem is that the Google bot will not be able to verify the existance of this file if you are using the standard .htacess hack, the one that enables you to remove index.php from your URLs

Standard Hack looks like this

AcceptPathInfo On
RewriteEngine on
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteCond
%{REQUEST_FILENAME} !-d  
RewriteRule
^(.*)$ /index.php/$1 [L]

Here’s a workaround that is tested and works on UNIX and LINUX servers.

First, create 2 blank files and upload them to the root directory of your website. Name one file googlexyzetc.html and one file googlexyzetc.htm these files should be blank and the permissions should be set to 775. Again the name of the file should come from Google itself. “xyzetc” is just a placeholder.

Then place the following code at the bottom of your .htaccess file

To make the Google Bot happy

Redirect 301 /googlexyzetc.html http://www.yoursite.com/googlexyz.htm/  
Redirect 301 /googleexyzetc.html/ http://www.yoursite.com/googlexyz.htm/
RedirectMatch 404 (.*).html$

Note that this hack will not work on a Windows server. Why? Because Windows does not accept multiple MIME types for HTML files. This hack is not particularly elegant but it has been tested and does work.

Category:Google Category:SEO Category:Hacks Category:.htaccess

Categories: