Ok, now I have one rule for wms <div><br><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">RewriteRule ^wms/([^/]+)$ /cgi-bin/qgis_mapserv.fcgi?map=/path-to-projects/$1.qgs [QSA,PT,L]</blockquote>


<div>(it works, you can see it in action here <a href="http://vega.faunalia.it/wms/candela?REQUEST=GetCapabilities" target="_blank">http://vega.faunalia.it/wms/candela?REQUEST=GetCapabilities</a>) </div><div><br></div><div>

one to have a short url with the project name </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">RewriteRule ^maps/([^./]+)/?$ /path-to-qgiswc/qgiswebclient.html?map=/path-to-projects/$1.qgs [PT,L]</blockquote>


<div><br></div><div>and one for html/js/css</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


RewriteRule ^maps/(.*) /path-to-qgiswc/$1 [PT]</blockquote><div><br></div><div>running the webapp with an example project I get an error about some not-well-specified missing parameters (i think the only one is missing is the project full path)</div>


<div>you can try here:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><a href="http://vega.faunalia.it/maps/candela" target="_blank">http://vega.faunalia.it/maps/candela</a></blockquote>


<div><br></div><div>Do you think my rewrite engine configuration is right or not?</div><div>Goodnight,</div><div> </div><br><div class="gmail_quote">2013/2/26 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If you do the redirects, I recommend to always do two redirects:<br>
<br>
* one for the WMS<br>
* one for the HTML/JSS/CSS files<br>
<br>
Here is what I use (modified to hide my paths):<br>
<br>
----------------<br>
<br>
#Rewrite Rules for QGIS webclient<br>
# Map /wms to qgis_mapserv.fcgi<br>
RewriteEngine On<br>
RewriteLog /var/log/apache2/webgis_rewrite.log<br>
RewriteLogLevel 0<br>
 #handle WMS requests to QGIS server<br>
RewriteRule ^/wms/(.+)$<br>
/cgi-bin/qgis_mapserv.fcgi?map=/www/projects/$1.qgs [QSA,PT,L]<br>
# Map /maps to /qgis-web-client<br>
# First handle the mapping of the starting html file - works for 1 to 7<br>
levels<br>
RewriteRule ^/maps/([^/.]+/{0,1}){1,7}$<br>
/qgis-web-client/qgiswebclient.html [PT,L]<br>
<br>
Hope this helps?<br>
<br>
Andreas<br>
<br>
<br>
Am <a href="tel:26.02.2013%2017" value="+12602201317" target="_blank">26.02.2013 17</a>:32, schrieb Emilio Loi:<br>
<div>> Thanks for your answer.<br>
> First, I'd corrected serverAndCGI value.<br>
><br>
> Without any redirect rule all works perfectly.<br>
> Currently I have only one RedirectRule that redirects any<br>
</div>> */wms/project*request to<br>
> *qgis_mapserv.fcgi* script),<br>
<div>><br>
>  <Directory /var/www/qgis-web-client/site/><br>
>         Options Indexes FollowSymLinks MultiViews<br>
>         AllowOverride all<br>
>         Order allow,deny<br>
>         allow from all<br>
>         RewriteEngine On<br>
>         RewriteRule wms/([^/]+)$<br>
> <a href="http://vega.faunalia.it/cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs[QSA,L]" target="_blank">http://vega.faunalia.it/cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs[QSA,L]</a><br>



><br>
>   </Directory><br>
><br>
><br>
> so I access to QGIS web client at this url (the actual one):<br>
><br>
> <a href="http://vega.faunalia.it/qgis-web-client/site/qgiswebclient.html?map=/var/www/qgis-web-client/projects/candela.qgs" target="_blank">http://vega.faunalia.it/qgis-web-client/site/qgiswebclient.html?map=/var/www/qgis-web-client/projects/candela.qgs</a><br>



><br>
><br>
</div>> Is it correct? It has full project path with project name in *map* request<br>
<div><div>> parameter.<br>
> Bye,<br>
><br>
><br>
> 2013/2/26 Andreas Neumann <<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>><br>
><br>
>> Hi,<br>
>><br>
>> You always have to specify a project path and project name with QGIS web<br>
>> client. Regardless whether you use URL rewriting or not. The client does<br>
>> not work without project path and name.<br>
>><br>
>> So a correct URL to start the client would be:<br>
>><br>
>> <a href="http://hostname/maps/projectpath/projectname?optionalParameters" target="_blank">http://hostname/maps/projectpath/projectname?optionalParameters</a><br>
>><br>
>> Of course this all depends on your setup.<br>
>><br>
>> This whole URL rewriting is a bit complex to set up. Before you do it I<br>
>> would recommend you test the client without URL rewriting, e.g. with a<br>
>> URL like:<br>
>><br>
>><br>
>> <a href="http://hostname/qgiswebclient.html?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs&format=image/png&visibleLayers=Rivers,Glaciated%20Areas,Lakes,Land,Ocean" target="_blank">http://hostname/qgiswebclient.html?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs&format=image/png&visibleLayers=Rivers,Glaciated%20Areas,Lakes,Land,Ocean</a><br>



>><br>
>> For 'var serverAndCGI = "<a href="http://THE_HOST/wms/" target="_blank">http://THE_HOST/wms/</a>"' I recommend to not<br>
>> specify the servername, in case you move the whole thing to another<br>
>> server. Better would be:<br>
>><br>
>> var serverAndCGI = "/wms/"<br>
>><br>
>> Hope this helps a bit?<br>
>><br>
>> Andreas<br>
>><br>
>><br>
>> Am <a href="tel:26.02.2013%2016" value="+12602201316" target="_blank">26.02.2013 16</a>:33, schrieb Emilio Loi:<br>
>>> Hi everybody, I hope you can help me.<br>
>>> I'm trying to enable URL Rewriting in Qgis-web-client as described at<br>
>> point<br>
>>> 5 of the configuration guide (<a href="https://github.com/qgis/qgis-web-client" target="_blank">https://github.com/qgis/qgis-web-client</a>)<br>
>>> I'm using this rule:<br>
>>><br>
>>> RewriteRule wms/([^/]+)$<br>
>>> cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs<br>
>>><br>
>>> It works well: when I browse <a href="http://THE_HOST/wms/example" target="_blank">http://THE_HOST/wms/example</a> on firefox the<br>
>>> server returns the cgi script result whit parameter<br>
>>> map=/var/www/.../example.qgs<br>
>>> Then I've set<br>
>>><br>
>>> var serverAndCGI = "<a href="http://THE_HOST/wms/" target="_blank">http://THE_HOST/wms/</a>"<br>
>>><br>
>>> in GlobalOptions.js instead of the full url.<br>
>>><br>
>>> The problem shows up when Qgis-web-client trys to use the cgi script:<br>
>>> instead of call /wms/example/?params it calls /wms/NOTHING/?params. (as<br>
>> you<br>
>>> can see)<br>
>>><br>
>>> [16:09:20.950] GET<br>
>>><br>
>> <a href="http://THE_HOST/wms//?&_dc=1361891360854&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings[HTTP/1.1" target="_blank">http://THE_HOST/wms//?&_dc=1361891360854&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings[HTTP/1.1</a><br>



>>> 404 Not Found 126ms]<br>
>>><br>
>>> What am I forgetting to configure?<br>
>>> Thanks in advance.<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Qgis-developer mailing list<br>
>>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>