本文 18279 pv
2
是关于要重写的地址当中有问号的。
Apache的重写地址为:
要转成nginx能识别的应写为:
相关nginx重写(rewrite)的参数请查看:http://www.geekso.com/nginx/
关于nginx重写(rewrite)问号遇到的问题
© kekehu / 技术资源 / 2009.02.03 / 17:01 / 18279PV
网站服务器从Apache换成nginx时遇到一个重写的问题。是关于要重写的地址当中有问号的。
Apache的重写地址为:
RewriteCond %{QUERY_STRING} ^lClassID=378$
RewriteRule ^ProductView\.jsp$ goods\.php\?id=27 [L]
RewriteRule ^ProductView\.jsp$ goods\.php\?id=27 [L]
要转成nginx能识别的应写为:
if ( $query_string = "lClassID=378" ){
rewrite ^ /goods.php?id=27 last;
}
rewrite ^ /goods.php?id=27 last;
}
相关nginx重写(rewrite)的参数请查看:http://www.geekso.com/nginx/
2011.07.03 10:02
很强大
2011.01.03 14:44
还不错