Welcome! Log In Create A New Profile

Advanced

Re: rewrite rules issue

April 19, 2015 04:06AM
Hello

Thanks for your reply.

If I remove the three lines, i get a 404 error. As a reminder, and maybe a little bit more clear :) here is the configuration.

Here is the directory path:

/var/www/domain.fr/web/subdomain/directory

my nginx conf is:

root /var/www/domain.fr/web

if ($http_host = "subdomain.domain.fr") {
rewrite ^(?!/\b(subdomain|stats|error)\b)/(.*)$ /subdomain/$2 last;
}

The if statement is before all of location directives.

After purging my cache browser, this is what I get:

when i reach http://subdomain.domain.fr/directory i'm redirected to http://subdomain.domain.fr/subdomain/directory (this is not what i want, i want http://subdomain.domain.fr/directory)

Thanks fo your help,
Best regards,
Nico
Subject Author Posted

rewrite rules issue

nicocolt April 18, 2015 04:08PM

Re: rewrite rules issue

Francis Daly April 18, 2015 05:04PM

Re: rewrite rules issue

nicocolt April 19, 2015 04:06AM

Re: rewrite rules issue

Francis Daly April 19, 2015 07:06AM

Re: rewrite rules issue

nicocolt April 19, 2015 09:53AM

Re: rewrite rules issue

Francis Daly April 19, 2015 06:52PM

Re: rewrite rules issue

nicocolt April 20, 2015 04:12AM

Re: rewrite rules issue

Francis Daly April 20, 2015 09:06AM

Re: rewrite rules issue

nicocolt April 21, 2015 09:26AM

Re: rewrite rules issue

Francis Daly April 21, 2015 04:50PM

Re: rewrite rules issue

nicocolt April 22, 2015 02:35PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready