June 24, 2013 08:58AM
Hello everyone,

I'm currently using Nginx 1.4.1 on CentOS 6.4 64bits and trying to perform a redirect of this type:
location /alpha {
location ~ ^/alpha/script.+([\d]+)$ {
return 301 /beta/info/$1/;
}
}

The originating location is /alpha/script.php?id=328.
The redirected location is /beta/info/328/.

For some reason, the above redirect returns a 404 with the URL:
http://www.domain.com/beta/script.php
Which does not exist anymore. It looks like the URI is not parsed from the regex?
I also tried this format, without success:
location ~ ^/alpha/script\.php?id=([\d]+)$ {

Thank you for your help.
Subject Author Posted

Redirection issues

TECK June 24, 2013 08:58AM

Re: Redirection issues

Maxim Dounin June 24, 2013 09:16AM

Re: Redirection issues

TECK June 24, 2013 09:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
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