Welcome! Log In Create A New Profile

Advanced

Rewrite URL String - Regex [NOT FIXED]

Posted by daragiu 
Rewrite URL String - Regex [NOT FIXED]
August 18, 2022 09:26AM
Hi,
I tried to use the rewrite to change one word from an URL and I can't see to find any solution. Basicaly I need the word "png" to transform into "jpeg".

My variant was this and it did't work.

location ~ ^/qtb/([^/]+)/?(.*)$
{
if ( $args ~* ^(.*)/png(.*)$ )
{
rewrite $args $1/jpeg$2;
}
}

I want to transform this URL:

http://localhost:8089/qtb/judete?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=349315.4219913930865,383373.4878520779312,486851.8865988351172,542404.8925680443645&CRS=EPSG:3844&WIDTH=1022&HEIGHT=883&LAYERS=ro_judete_poligon&STYLES=&FORMAT=image%2Fpng&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96

In to this URL:

http://localhost:8089/qtb/judete?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=349315.4219913930865,383373.4878520779312,486851.8865988351172,542404.8925680443645&CRS=EPSG:3844&WIDTH=1022&HEIGHT=883&LAYERS=ro_judete_poligon&STYLES=&FORMAT=image%2Fjpeg&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready