Created
January 20, 2014 06:48
-
-
Save JingwenTian/8516025 to your computer and use it in GitHub Desktop.
YAF 在Nginx环境下的Rewrite规则
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Yaf手册提供的Nginx的Rewrite (nginx.conf) | |
#vi /usr/local/nginx/conf/nginx.conf | |
server { | |
listen ****; | |
server_name domain.com; | |
root document_root; | |
index index.php index.html index.htm; | |
if (!-e $request_filename) { | |
rewrite ^/(.*) /index.php/$1 last; | |
} | |
} | |
#错误的地方在: | |
rewrite ^/(.*) /index.php/$1 last; | |
正确的写法为: | |
rewrite ^/(.*) /index.php?$1 last; | |
#修改完后,重启nginx: /etc/init.d/nginx restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
同样遇到了。感谢。已解决。