<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;">I Want to change this:</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><br>
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><b>https://<our
server>/cgi-bin/mapserv?map=/usr/share/mapserv/mapfile.map&service=wms&version=1.3.0&request=GetCapabilities</b><br>
<br>
To this:<br>
<br>
<b>https://<our
server>/wms?service=WMS&version=1.3.0&request=GetCapabilities</b><br>
<br>
So I've enabled apache2 mod-rewrite and created a .htaccess file
with the following rule as per Mapserver docs:<br>
<br>
<b>RewriteEngine on</b><b><br>
</b><b>RewriteRule wms?(.*)
/cgi-bin/mapserv?map=/usr/share/mapserv/mapfile.map&$1</b><b><br>
</b><br>
I've also adapted this rule to numerous variations to try and get
it working but to no avail.<br>
The first link returns xml as expected.<br>
The second link returns this error:<br>
<br>
<b>mapserv(): Web application error. Traditional BROWSE mode
requires a TEMPLATE in the WEB section, but none was provided.</b><br>
<br>
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;">I've an error log
running for the rewrite with an example trace as follows:</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><br>
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px none; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-stretch: inherit;
line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;"><b>[Thu Jun 09 18:54:22.033848 2022] [rewrite:trace3]
[pid 40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] [perdir
/var/www/html/] strip per-dir prefix: /var/www/html/wms ->
wms</b><b><br>
</b><b>[Thu Jun 09 18:54:22.033855 2022] [rewrite:trace3] [pid
40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] [perdir
/var/www/html/] applying pattern 'wms?(.*)' to uri 'wms'</b><b><br>
</b><b>[Thu Jun 09 18:54:22.033864 2022] [rewrite:trace2] [pid
40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] [perdir
/var/www/html/] rewrite 'wms' ->
'/cgi-bin/mapserv?map=/usr/share/mapserv/gni_wms.map&'</b><b><br>
</b><b>[Thu Jun 09 18:54:22.033870 2022] [rewrite:trace3] [pid
40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] split
uri=/cgi-bin/mapserv?map=/usr/share/mapserv/gni_wms.map&
-> uri=/cgi-bin/mapserv,
args=map=/usr/share/mapserv/gni_wms.map</b><b><br>
</b><b>[Thu Jun 09 18:54:22.033877 2022] [rewrite:trace2] [pid
40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] [perdir
/var/www/html/] trying to replace context docroot /var/www/html
with context prefix</b><b><br>
</b><b>[Thu Jun 09 18:54:22.033883 2022] [rewrite:trace1] [pid
40275:tid 140188000974592] mod_rewrite.c(483): [client
<browser IP>:62351] <browser IP> - - [<our
server>/sid#7f80151c0340][rid#7f80147130a0/initial] [perdir
/var/www/html/] internal redirect with /cgi-bin/mapserv
[INTERNAL REDIRECT]</b><b><br>
</b></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><br>
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
var(--s-prose-spacing); margin-left: 0px; padding: 0px; border:
0px; font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-variant-numeric: inherit;
font-variant-east-asian: inherit; font-weight: 400; font-stretch:
inherit; line-height: inherit; font-family: -apple-system,
BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe
UI", "Liberation Sans", sans-serif; font-size:
15px; vertical-align: baseline; box-sizing: inherit; clear: both;
color: rgb(35, 38, 41); letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;">Am I correct in thinking
that the redirect is not handling the GET params?</p>
<p style="margin: 0px; padding: 0px; border: 0px; font-style:
normal; font-variant-ligatures: normal; font-variant-caps: normal;
font-variant-numeric: inherit; font-variant-east-asian: inherit;
font-weight: 400; font-stretch: inherit; line-height: inherit;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI
Adjusted", "Segoe UI", "Liberation Sans",
sans-serif; font-size: 15px; vertical-align: baseline; box-sizing:
inherit; clear: both; color: rgb(35, 38, 41); letter-spacing:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;">Which means my rule is wrong and is hence passing the
wrong request string to mapserver thus causing the error?</p>
<p style="margin: 0px; padding: 0px; border: 0px; font-style:
normal; font-variant-ligatures: normal; font-variant-caps: normal;
font-variant-numeric: inherit; font-variant-east-asian: inherit;
font-weight: 400; font-stretch: inherit; line-height: inherit;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI
Adjusted", "Segoe UI", "Liberation Sans",
sans-serif; font-size: 15px; vertical-align: baseline; box-sizing:
inherit; clear: both; color: rgb(35, 38, 41); letter-spacing:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;"><br>
</p>
<p style="margin: 0px; padding: 0px; border: 0px; font-style:
normal; font-variant-ligatures: normal; font-variant-caps: normal;
font-variant-numeric: inherit; font-variant-east-asian: inherit;
font-weight: 400; font-stretch: inherit; line-height: inherit;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI
Adjusted", "Segoe UI", "Liberation Sans",
sans-serif; font-size: 15px; vertical-align: baseline; box-sizing:
inherit; clear: both; color: rgb(35, 38, 41); letter-spacing:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;">Paul<br>
</p>
</body>
</html>