<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:0cm;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.hps
        {mso-style-name:hps;}
span.shorttext
        {mso-style-name:short_text;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Greetings to everyone on the user list.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Sorry for my english. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I have a problem to submit because I cannot frame it properly: I do not expect that you will solve it but you can provide guidance on how to deal with it and I move on. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>According with mapserver wms server howto at </span><a href="http://mapserver.org/ogc/wms_server.html"><span lang=EN-US style='color:windowtext;text-decoration:none'>http://mapserver.org/ogc/wms_server.html</span></a><span lang=EN-US>, in section “Changing the Online Resource URL” I follow the indication “Apache environment variables – MS_MAPFILE”. So I create a link in http cgi-bin folder named mywms which points to /usr/lib/cgi-bin/mapserv, the application/executable file.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>My http.conf file contain instruction:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Alias /mywms /usr/lib/cgi-bin/mapserver<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><Location /mywms><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>SetHandler cgi-script<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>Options ExecCGI<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>SetEnv MS_MAPFILE  /var/www/biss.org/public_html/pmapper/config/default/pmapper_demo_wms.map<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US></Location><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And the application correctly works and in a wms gis client I can connect to wms server with follow link </span><a href="http://www.biss.org/mywms"><span lang=EN-US>www.biss.org/mywms</span></a><span lang=EN-US>.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>This is configuration to access to a single default mapfile (pmapper_demo_wms.map).<o:p></o:p></span></p><p class=MsoNormal><span class=hps><span lang=EN>In a similar way</span></span><span lang=EN> <span class=hps>for a</span> wfs <span class=hps>server</span> <span class=hps>with</span> <span class=hps>pmapper_demo_wfs.map (mywfs link in cgi-bin folder, …)<o:p></o:p></span></span></p><p class=MsoNormal><span class=hps><span lang=EN><o:p> </o:p></span></span></p><p class=MsoNormal><span lang=EN-US>My project manager wants to change the settings of project by create individual mapfile (not only one, the default) for each registered user and so I need  to access the individual mapfiles inserting different links: in other words in a wms gis client I put the link </span><a href="http://www.biss.org/mywms_123_45"><span lang=EN-US>www.biss.org/mywms_123_45</span></a><span lang=EN-US> to point to the file pmapper_demo_wms_123_45.map (123_45 represents a registered user id, one of actually 75 registered users!! So I don’t create 75 and on link…). The map files are created automatically by the database on user’s registration for both wms e wfs mapfile.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>So I changed in http.conf toward rewrite rule solution (and remove references to Alias /mywxx and <Location /mywxx> for both mywms and mywfs)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>in<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <Directory “…/public_html”><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>….<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>RewriteEngine on<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>RewriteRule myw?(.)s(.*)$  /cgi-bin/mapserv?map=/var/www/biss.org/public_html/pmapper/config/default/pmapper_demo_w$1s$2.map&SERVICE=W$1S&REQUEST=GetCapabilities&<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US></Directory><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>So when I put <a href="http://www.biss.org/mywms_123_45">http://www.biss.org/mywms_123_45</a> in QGIS --> add WMS layer it works because point to pmapper_demo_wms_123_45.map&SERVICE=WmS&REQUEST=GetCapabilities according to $1=m and $2=_123_45 variables.<o:p></o:p></span></p><p class=MsoNormal><span class=hps><span lang=EN>The problem arises</span></span><span class=shorttext><span lang=EN> </span></span><span class=hps><span lang=EN>with</span></span><span class=shorttext><span lang=EN> </span></span><span class=hps><span lang=EN>wfs</span></span><span class=shorttext><span lang=EN> </span></span><span class=hps><span lang=EN>request in QGIS </span></span><span class=hps><span lang=EN style='font-family:Wingdings'>à</span></span><span class=hps><span lang=EN> add WFS vector. Putting </span></span><span lang=EN-US><a href="http://www.biss.org/mywfs_123_45">http://www.biss.org/mywfs_123_45</a> QGIS (and other wfs client similar) sends the response in attached “Il server WFS non supporta la versione WFS 1.0.0 oppure l’ URL è errato” (Italian language!!) while putting <a href="http://www.biss.org/cgi-bin/mapserv?map=/var/www/biss.org/public_html/pmapper/config/default/pmapper_demo_wfs_123_45.map">http://www.biss.org/cgi-bin/mapserv?map=/var/www/biss.org/public_html/pmapper/config/default/pmapper_demo_wfs_123_45.map</a> it works correctly (which demonstrate that mapfile is ok! and in the layer properties I read correctly …&SERVICE=WFS&VERSION=1.0.0&REQ….)<o:p></o:p></span></p><p class=MsoNormal><span class=hps><span lang=EN>what</span></span><span lang=EN> <span class=hps>it is due to</span> <span class=hps>the difference in behavior</span> <span class=hps>for</span> <span class=hps>mapserver</span> <span class=hps>when rewrite</span> <span class=hps>the</span> <span class=hps>url? Is it a feature of wfs server?</span></span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Can you direct me?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks in advance. Pasquale.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>PS. Apache2 version 2.4.7 on Ubuntu 14.04 MapServer 6.4.1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>