{"id":705,"date":"2010-02-11T13:27:20","date_gmt":"2010-02-11T12:27:20","guid":{"rendered":"http:\/\/sickel.net\/blogg\/?p=705"},"modified":"2011-04-18T19:54:41","modified_gmt":"2011-04-18T17:54:41","slug":"hiding-the-map-parameter-from-a-map-server-application","status":"publish","type":"post","link":"http:\/\/sickel.net\/blogg\/?p=705","title":{"rendered":"Hiding the map= parameter from a map server application"},"content":{"rendered":"<p>In the mapserver documentation, one is told to use a cgi-wrapper script to hide the map= parameter. Then there is shown a script to use on &#8216;any system having a \/bin\/sh&#8217; I tried to rewrite that as a php-script to use under windows, but that did not work, so apaches mod_rewrite to the rescue in four small steps:<\/p>\n<ol>\n<li>make sure the mod_rewrite is enabled in httpd.conf. Usually it is commented out by default, if necessary remove the comment sign.\n<\/li>\n<li>Enable mod_rewrite for the actual document root. I am using virtual servers and added the following lines in the actual &lt;VirtualHost &gt; section:\n<p>&lt;Directory &#8220;c:\\documents and settings\\vserver\\radioecology&#8221;&gt;<br \/>\n\t\tOptions FollowSymLinks<br \/>\n\t\tAllowOverride All<br \/>\n&lt;\/Directory&gt;\n<\/li>\n<li>Restart apache\n<\/li>\n<li>make a .htaccess file in the actual directory:<br \/>\n<blockquote><p>RewriteEngine on<br \/>\nRewriteRule ^wmsmap?(.*) \/cgi-bin\/mapserv.exe?map=\/documents+and+settings\/vserver\/radioecology\/mobilweb\/mobilwms.map&#038;$1<\/p><\/blockquote>\n<p>(Everything following  RewriteRule must be on one line. in this case, the map file I want to pull in is &#8220;\/documents+and+settings\/vserver\/radioecology\/mobilweb\/mobilwms.map&#8221; adjust as needed for your application.)<\/p>\n<p>The rewriteRule says: given a webpage starting with wmsmap, pick out the query parameters, make a new page request starting with \/cgi-bin\/mapserv.exe?map=(&#8230;)? and add on whatever was the query parameter in the original page request. Quite simple when one just knows how to do it.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In the mapserver documentation, one is told to use a cgi-wrapper script to hide the map= parameter. Then there is shown a script to use on &#8216;any system having a \/bin\/sh&#8217; I tried to rewrite that as a php-script to &hellip; <a href=\"http:\/\/sickel.net\/blogg\/?p=705\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1,20],"tags":[],"class_list":["post-705","post","type-post","status-publish","format-standard","hentry","category-div","category-mapserver"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnVtD-bn","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=705"}],"version-history":[{"count":5,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/705\/revisions"}],"predecessor-version":[{"id":1000,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/705\/revisions\/1000"}],"wp:attachment":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=705"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}