0

I have setup the python proxy.cgi in cgi-bin folder in my server.

[myserver]/cgi-bin/proxy.cgi returns the openlayers website

[myserver]/cgi-bin/proxy.cgi?url=www.openlayers.org returns list index out of range (www.openlayer.org is defeined in the allowed host)

[myserver]/cgi-bin/proxy.cgi?url="www.openlayers.org" returns list index out of range (www.openlayer.org is defeined in the allowed host)

[myserver]/cgi-bin/proxy.cgi?url=http://www.openlayers.org returns page not found

[myserver]/cgi-bin/proxy.cgi?url="http://www.openlayers.org" returns page not found

The proxy is working, but if i use url without http it gives list index out of range, if i use http in url the script is failing.

The url i wasnt to access is http://www.openstreetmap.org/api/0.6/way/190554764 and the cross domain issue is not allowing.

1
  • Do you see anything in the apache logs? Apr 22, 2013 at 7:25

1 Answer 1

1

You need to encode special characters (colons, slashes) in the url you want to access. In JavaScript you can use encodeURIComponent(), e.g. '[myserver]/cgi-bin/proxy.cgi?url=' + encodeURIComponent('http://www.openlayers.org')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.