[GIS] “File not found at…” error when loading KML into Google Maps

google mapskml

I have a KML file on a public URL like http://host.com/dir/file.kml

If I put that KML file on another server, and put the new URL in the search box on Google Maps, it loads the KML into google maps.

If I put the above URL into google maps like so: http://maps.google.com/maps?q=http://host.com/dir/file.kml

It does not load, and I get the following message:

File not found at http://host.com/dir/f....

Suggestions:

    Make sure the URL is spelled correctly.
    Make sure the file exists.

Therefore, I assume this is a configuration issue on the server. They are not being very helpful with debugging/configuring. Can anyone here offer advice on how to fix this?

Best Answer

Important note on using KML & KMZ on your hosted server

Windows:

Set the MIME on the server for accessing kml/kmz for Google Earth, Google Maps & Google Maps API reads KML and KMZ files. The standard MIME type for KML files is

* application/vnd.google-earth.kml+xml

The standard MIME type for KMZ files is

* application/vnd.google-earth.kmz

For Apache, add these lines to the httpd.conf file or a .htaccess file in the same folder (if your host only allows htaccess rather than httpd.conf access):

* AddType application/vnd.google-earth.kml+xml .kml
* AddType application/vnd.google-earth.kmz .kmz 

For Linux:

* AddType application/vnd.google-earth.kml+xml .kml  

* AddType application/vnd.google-earth.kmz .kmz  

  Application: opt/google-earth/googleearth 

I posted this here back in 2007 http://groups.google.com/group/google-maps-api/web/more-info-kml-on-google-maps