Re: rewrite rules issue

2015-04-22 Thread nicocolt
Hi Francis Ok. Many thanks for your interest of my problem. Best regards Nico Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258184,258308#msg-258308 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: rewrite rules issue

2015-04-21 Thread nicocolt
Hello Francis, server { listen *:80; server_name domain.fr www.domain.fr subdomain.domain.fr; root /var/www/domain.fr/web; if ($http_host = "subdomain.domain.fr") { rewrite ^(?!/\b(bar|stats|error)\b)/(.*)$ /bar/$2 last; } index i

Re: rewrite rules issue

2015-04-20 Thread nicocolt
Hi Francis, I have set a new server block, but i'm facing with the initial problem. So let me re-explain it. Now i have: server name stuff.domain.fr root /var/www/domain.fr/web/subdomain; In the subdomain directory i have foo firectory /var/www/domain.fr/web/subdomain/foo/ so now in my browse

Re: rewrite rules issue

2015-04-19 Thread nicocolt
Hello, you're right, my rewrite says that my request is handle like http://subdomain.domain.fr/subdomain/directory/. But it is not that i want. I want that my request is handled like this: http://subdomain.domain.fr/directory/ and i don't want see the intermediate path. I don't understand how to

Re: rewrite rules issue

2015-04-19 Thread nicocolt
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 = "

rewrite rules issue

2015-04-18 Thread nicocolt
Hello, I have an issue with a rewrite rule for redirect to a subdomain. Here it is: if ($http_host = "subdomain.domain.fr") { rewrite ^(?!/\b(subpath|stats|error)\b)/(.*)$ /subpath/$2 last; } if in my browser i write: host.domain.fr/admin (without last /), then I'm redirected to host