[Qgis-user] Web Client: Url Rewriting
Gunnar Oehmichen
oehm8895 at uni-landau.de
Sat May 17 06:20:47 PDT 2014
Hello there,
I took another try to get the url rewriting working. The client has just
been checked out and before making any changings to the url-rewriting
part in the apache-conf/qgis-web-client.conf and in var serverAndCGI in
GlobalOptions.js everything was working fine when using an url like:
gis.dienst.uni-landau.de/qgiswebclient.html?map=/var/www/gis.dienst.uni-landau.de/projects/test_url.qgs
.
sytem settings:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
qgis: Version: 2.2.0-2+precise1
qgismapserver: Version: 2.2.0-2+precise1
qgis-web-client: checked out 05/15/2014
Qgis-web-client is installed in:
/var/www/gis.dienst.uni-landau.de
.qgs files are within
/var/www/gis.dienst.uni-landau.de/projects/
To be able to use the url gis.dienst.uni-landau.de/karten/test_url to
open the project projects/test_url.qgs i made the following changes as
suggested by the README:
GlobalOptions.js:
var serverAndCGI"/cgi-bin/qgis_mapserv.fcgi" -> var serverAndCGI = "/wms";
apache-config/qgis-web-client.confg:
# optional rewrite rules
# Forbid direct access
RewriteRule ^/cgi-bin/.*$ - [F]
# Search with SearchPanel
# sample search on layer 'Hello'
RewriteCond %{QUERY_STRING} ^(?:.*)query=samplesearch&*(?:.*)$
RewriteCond %{QUERY_STRING} ^(?:(?:.*)&)?colour=([^&]*)(?:.*)$
RewriteRule ^/wms/(.+)$
/cgi-bin/qgis_mapserv.fcgi?map=/var/www/gis.dienst.uni-landau.de/projects/$1.qgs&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=Hello&QUERY_LAYERS=Hello&FEATURE_COUNT=20&INFO_FORMAT=text/xml&SRS=EPSG:4326&FILTER=Hello:"colour"\
=\ '%1' [PT]
# Rewrite /wms/mapname to
qgis_mapserv.fcgi?map=/<path-to-qgis-server-projects>/mapname.qgs
RewriteRule ^/wms/(.+)$
/cgi-bin/qgis_mapserv.fcgi?map=/var/www/gis.dienst.uni-landau.de/projects/$1.qgs
[QSA,PT]
# Rewrite /maps/mapname to qgis-web-client main page. mapname will be
extracted for wms calls in Javascript code.
RewriteRule ^/karten/([^\.]+)$
/gis.dienst.uni-landau.de/site/qgiswebclient.html [PT]
# Rewrite /maps/* to qgis-web-client/site (e.g.
/maps/gis_icons/mActionZoomNext.png ->
/qgis-web-client/site/gis_icons/mActionZoomNext.png)
RewriteRule ^/karten/(.*) /gis.dienst.uni-landau.de/site/$1 [PT]
Your help would be appreciated very much. How can I get the
url-rewriting to work?
Have a nice and sunny weekend,
Gunnar
More information about the Qgis-user
mailing list