Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

A regex catch not working

$
0
0
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

Viewing all articles
Browse latest Browse all 53287

Trending Articles