Welcome! Log In Create A New Profile

Advanced

nginx 2 conflicting rewrite rules - please help!

Posted by tomek493 
nginx 2 conflicting rewrite rules - please help!
March 31, 2013 08:18PM
Hey guys - I've been struggling for so long with this problem, and have absoloutley no idea what's going on :( Any help would be apprieciated.

I have the following 2 rules:

rewrite ^(/posts.php) /controllers/read/C_ReadAllPosts.php?type=$arg_type last; break;
rewrite ^/(.+)/?$ /controllers/read/C_ReadBlogURL.php?url=$1 last; break;

Only the rule which comes first ever works. Taking out the break; statements causes only the last one to ever work. Making the second rule more explicit by matching [^\.php] also does not help.

I don't know why this is - the rule which doesn't work returns a 404, even though it shouldn't - and is available if I put that rule first.

Thank you so much for any help.

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

Click here to login

Online Users

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