Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the default MapServer URL to view the map in browser.


How can I convert it to more general style such as ?

I just need to show my map in a specific URL like in or and nothing more. For example I want to hide my directories showing such as /home/mwh/osm-demo/basemaps/ in the original URL. How can I achieve this?

share|improve this question

You need to create a wrapper script to achieve this

if [ "${REQUEST_METHOD}" = "GET" ]; then
  if [ -z "${QUERY_STRING}" ]; then
  exec ${MAPSERV}
  echo "Sorry, I only understand GET requests."
exit 1
# End of Script


PS: the script only works for GET requests.

Another alternative is to use php/python mapscript for creating the web pages. its very easy and you need to install corresponding mapscript bindings see here for more info. Here is an example of php mapscript

share|improve this answer
Thank you @rashad for quick reply. I tried the example (the php one). I am stuck from the beginning. When I execute my .php file in browser nothing appears as told in the first output of the example. I used the example .php code given and used the mapfile I had. I changed the $map_path to my basemaps folder which included the file. – MWH May 22 '13 at 11:59
what does the error log says. if you are using ubuntu it should be located in /var/log/apache2/error.log. else please find the location of apache error log and access log – rashad May 22 '13 at 12:49

There are alternatives to wrapper scripts. See:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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