Hind the QGS path in the MAP Variable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hind the QGS path in the MAP Variable

juliermeopensourcedeveloper
Hi Developers,

I have hit the head in a wall trying to hind the .qgs file in the MAP variable. I want to change FROM localhost/cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/project/map.qgs
TO localhost/cgi-bin/qgis_mapserv.fcgi?map=map.qgs

Find below my unsuccessful attempt:

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^cgi-bin/qgis_mapserv.fcgi\?map\=([a-zA-Z0-9_-]+)\.qgs$ cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/project/$1 [NC,QSA,L]

Any help will very much appreciated

I appreciate your time in advance.

Kind regards

Julierme

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Hind the QGS path in the MAP Variable

Nicolas Boisteault-4

Hi,

I think you should use QGIS_PROJECT_FILE environment variable for this purpose.

Regards

Le 08/04/2021 à 04:05, 1520 gis a écrit :
Hi Developers,

I have hit the head in a wall trying to hind the .qgs file in the MAP variable. I want to change FROM localhost/cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/project/map.qgs
TO localhost/cgi-bin/qgis_mapserv.fcgi?map=map.qgs

Find below my unsuccessful attempt:

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^cgi-bin/qgis_mapserv.fcgi\?map\=([a-zA-Z0-9_-]+)\.qgs$ cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/project/$1 [NC,QSA,L]

Any help will very much appreciated

I appreciate your time in advance.

Kind regards

Julierme

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Hind the QGS path in the MAP Variable

Alessandro Pasotti-2
On Thu, Apr 8, 2021 at 9:10 AM Nicolas Boisteault <[hidden email]> wrote:
>
> Hi,
>
> I think you should use QGIS_PROJECT_FILE environment variable for this purpose.
>


... or mod_rewrite as an alternative for Apache.

Nginx has a similar functionality.

--
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Hind the QGS path in the MAP Variable

juliermeopensourcedeveloper
Thank you very much Mr. Pasotti and Mr. Boisteault for the reply.

Following Mr. Boisteault recommendation, I am already setting QGIS_PROJECT_FILE, but this variable points only to .qgs file (default). Instead of pointing to a file, I tried setting a directory to QGIS_PROJECT_FILE, as: /home/qgis/projects/ or /home/qgis/projects/* or /home/qgis/projects/*.*, but no success. In this case, I think we will need to set QGIS_PROJECT_DIRECTORY instead of a file. 

Now, according to MR Pasotti, I am already struggling while working on mod_rewrite. Find below my attempt without success:

RewriteEngine on
RewriteCond %{REQUEST_URI}  ^cgi-bin/qgis_mapserv.fcgi$
RewriteCond %{QUERY_STRING} ^map=map.qgs$
RewriteRule ^cgi-bin/qgis_mapserv.fcgi\?$ /cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/project/%1 [NC,QSA,R,L]

I appreciated your time

Kind regards

Julierme

On Thu, Apr 8, 2021 at 4:14 AM Alessandro Pasotti <[hidden email]> wrote:
On Thu, Apr 8, 2021 at 9:10 AM Nicolas Boisteault <[hidden email]> wrote:
>
> Hi,
>
> I think you should use QGIS_PROJECT_FILE environment variable for this purpose.
>


... or mod_rewrite as an alternative for Apache.

Nginx has a similar functionality.

--
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user