Rewrite to pretty links with nginx

2019-08-11 00:23发布

问题:

Basically the question is how to make this url

http://domain.com/folder/cache.php?a=3a1c2aa4d440d3d8ce4207b07488ae4d?g=67h

to look like this

http://domain.com/folder/3a1c2aa4d440d3d8ce4207b07488ae4d?g=67h

回答1:

This worked

rewrite ^/folder/(.*)$ /folder/cache.php?a=$1?$args? last;



回答2:

rewrite ^/folder/(.*)$ /folder/cache.php?a=$1$is_args$args? last;