Extending use of Apache SetEnvIf for Online Resource URL

Eduin Carrillo yecarrillo at YAHOO.COM
Thu Jan 26 10:51:20 EST 2006


Using instructions of
http://mapserver.gis.umn.edu/docs/howto/wms_server/#more-about-the-online-resource-url
I were trying to extend this trick to do something more functional.
Using JUST ONE executable and passing the MS_MAPFILE environment based on a
external parameter (SERVICENAME in this case) on URL request:

mapserv?SERVICENAME=mymapfile

And Apache do the magic to provide the MS_MAPFILE environment based on
SERVICENAME parameter: MS_MAPFILE=/path/to/mymapfile.map

this is the httpd.conf code:

    RewriteCond %{QUERY_STRING} (.*)servicename=([^&]+) [NC]
    RewriteRule ^(.*)$ $1 [QSA,E=MS_MAPFILE:/path/to/%2.map]

Benefits? Just one exe file and a short URL (not passing all path)

It works for most cgi-bin requests, however OGC capabilities requests returns
invalid "OnlineResource" links (for this reason uDIG shows empty maps).

For a normal request (mapserv?map=/path/to/mymapfile.map), OnlineResource link
into capabilities is:
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://example.com/cgi-bin/mapserv?map=/path/to/mymapfile.map&amp;"/>

Using my trick (mapserv?SERVICENAME=mymapfile), OnlineResource link into
capabilities is:
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://example.com/cgi-bin/mapserv?"/>

Somebody knows some kind of solution to get a valid OnlineResource links into
capabilities file?

Eduin Yezid Carrillo Vega
GIS Specialist
http://eduinyezid.carrillovega.com
http://sig.cas.gov.co/~yecarrillo

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 



More information about the mapserver-users mailing list