Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx 2 conflicting rewrite rules - please help!

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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>