[Qgis-developer] URL Rewriting and qgis-web-client

Emilio Loi loi at faunalia.it
Tue Feb 26 08:32:31 PST 2013


Thanks for your answer.
First, I'd corrected serverAndCGI value.

Without any redirect rule all works perfectly.
Currently I have only one RedirectRule that redirects any
*/wms/project*request to
*qgis_mapserv.fcgi* script),

 <Directory /var/www/qgis-web-client/site/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        RewriteEngine On
        RewriteRule wms/([^/]+)$
http://vega.faunalia.it/cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs[QSA,L]

  </Directory>


so I access to QGIS web client at this url (the actual one):

http://vega.faunalia.it/qgis-web-client/site/qgiswebclient.html?map=/var/www/qgis-web-client/projects/candela.qgs


Is it correct? It has full project path with project name in *map* request
parameter.
Bye,


2013/2/26 Andreas Neumann <a.neumann at carto.net>

> Hi,
>
> You always have to specify a project path and project name with QGIS web
> client. Regardless whether you use URL rewriting or not. The client does
> not work without project path and name.
>
> So a correct URL to start the client would be:
>
> http://hostname/maps/projectpath/projectname?optionalParameters
>
> Of course this all depends on your setup.
>
> This whole URL rewriting is a bit complex to set up. Before you do it I
> would recommend you test the client without URL rewriting, e.g. with a
> URL like:
>
>
> http://hostname/qgiswebclient.html?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs&format=image/png&visibleLayers=Rivers,Glaciated%20Areas,Lakes,Land,Ocean
>
> For 'var serverAndCGI = "http://THE_HOST/wms/"' I recommend to not
> specify the servername, in case you move the whole thing to another
> server. Better would be:
>
> var serverAndCGI = "/wms/"
>
> Hope this helps a bit?
>
> Andreas
>
>
> Am 26.02.2013 16:33, schrieb Emilio Loi:
> > Hi everybody, I hope you can help me.
> > I'm trying to enable URL Rewriting in Qgis-web-client as described at
> point
> > 5 of the configuration guide (https://github.com/qgis/qgis-web-client)
> > I'm using this rule:
> >
> > RewriteRule wms/([^/]+)$
> > cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs
> >
> > It works well: when I browse http://THE_HOST/wms/example on firefox the
> > server returns the cgi script result whit parameter
> > map=/var/www/.../example.qgs
> > Then I've set
> >
> > var serverAndCGI = "http://THE_HOST/wms/"
> >
> > in GlobalOptions.js instead of the full url.
> >
> > The problem shows up when Qgis-web-client trys to use the cgi script:
> > instead of call /wms/example/?params it calls /wms/NOTHING/?params. (as
> you
> > can see)
> >
> > [16:09:20.950] GET
> >
> http://THE_HOST/wms//?&_dc=1361891360854&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings[HTTP/1.1
> > 404 Not Found 126ms]
> >
> > What am I forgetting to configure?
> > Thanks in advance.
> >
> >
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130226/bf614433/attachment.html>


More information about the Qgis-developer mailing list