Nginx rewrite rules, some work, some don't
- by Lawrence Goldstien
Here are the two rewrite rules:
This one works
rewrite ^/knowledgebase/([0-9]+)/[a-z0-9_-]+.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
This one doesn't
rewrite ^/announcements/([0-9]+)/[a-z0-9_-]+.html$ /./announcements.php?id=$1 last;
There is no difference between the two as far as I can see. The url to be rewritten for announcements is:
/announcements/2/New-Site-Design.html
And should be rewritten to:
/announcements.php?id=2
I really can't see how the announcements one doesn't work compared to the knowledgebase one. Any tips would be greatly appreciated.