Problem in reading kml data in openlayers

I am trying to read an KML file (point feature) and show it on a vector layer on OSM as the base map. My code seems to have a problem that does not show the features on the map. Firebug shows that it cannot find the path to kml file, gives a 404 not found error. Tried it on local machine works fine, but on server gives this error. Any help would be appreciatedā€¦ Thanks! :wink:

My code:

<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
    <script>
      function init() {
        map = new OpenLayers.Map("map");
        var mapnik         = new OpenLayers.Layer.OSM();
        var fromProjection = new OpenLayers.Projection("EPSG:4326");   // Transform from WGS 1984
        var toProjection   = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
        var position       = new OpenLayers.LonLat(48.69,31.345).transform( fromProjection, toProjection);
        var zoom           = 12; 
        var layer = new OpenLayers.Layer.Vector("KML", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
            url: "points.kml",
            format: new OpenLayers.Format.KML()
            })
        });
        map.addLayers([mapnik, layer]);
        map.addControl(new OpenLayers.Control.LayerSwitcher());
        map.setCenter(position, zoom );
      }

and my kml data:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>Agencies test</name>
<Folder>
<name>BlahBlah!</name>
<Placemark id="2">
<name>Something here!</name>
<description>test</description>
<LookAt>
<longitude>49.69</longitude>
<latitude>32.345</latitude>
<altitude>0</altitude>
<range>24.63686803544318</range>
<tilt>0</tilt>
<heading>1.387289180270979e-005</heading>
</LookAt>
<Point>
<coordinates>49.69,32.345,0</coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>

Well. the problem is solved. Sorts out that the server did not give permission to read KML file type. That was the reason! daaaah! :stuck_out_tongue: