general rule for rewrite

etrader nginx-forum at nginx.us
Mon Jul 25 12:35:23 UTC 2011


I use this rewrite rule to create SEO friendly urls
rewrite ^/search/(.*).html /search.php?q=$1 last;

I have similar rewrites too; I wonder if it is possible to write a
general rule to do so for all php files?
I mean rewrites filename.php?q=something to /filename/something.html

instead of writing a rewrite rule for each php file

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212912,212912#msg-212912



More information about the nginx mailing list