Welcome! Log In Create A New Profile

Advanced

A regex catch not working

Posted by Larry 
A regex catch not working
February 28, 2013 03:46AM
Hi,

I have a little problem with my regex.

Here is my code :
[code]

location / {

try_files /static/index.html @otherrules;
}
location ~* /^.+$ {

try_files /static/$uri $uri/ @otherrules;
}
[/code]

My goal is to redirect people if they type http://www.mysite.com/ to the static index.html and if they type something after the /, that the second rule applies.

But the first one is always the one picked up.

Why is that ? I just want to check if there is something after the last slash without using any if statement (cpu load).

Is my regex fucked up ?

Thanks !

Larry
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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