如何为nginx设置这个重写?

时间:2012-04-06 14:45:22

标签: nginx

请帮帮我。如何为nginx 1.0.14设置此重写?

RewriteRule ^([^/]*)\.html$ /?page=$1 [QSA,L]
RewriteRule ^([^-]*)-([^-]*)/$ /index.php?page=$1&act=$2 [QSA,L]
RewriteRule ^([[:alnum:]]{8})/*$ /index.php?page=paste&id=$1 [QSA,L]

1 个答案:

答案 0 :(得分:0)

结帐http://wiki.nginx.org/HttpRewriteModule#rewrite

类似的东西:

rewrite ^([^/]*)\.html$ /?page=$1 last;
rewrite ^([^-]*)-([^-]*)/$ /index.php?page=$1&act=$2 last;
rewrite ^([[:alnum:]]{8})/*$ /index.php?page=paste&id=$1 last;
return 403;