请问nginx服务器的去index.php的rewrite要怎么写?
我服务器用的是nginx,用帮助里写的那种规则没效。。 le_el 发表于 2010-12-29 14:01if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;
是的,还是层主这个好 楼主应该参考 nginx 的 rewrite 规则。
最主要的就是要实现把 www.domain.com/xxxx 映射成 www.domain.com/index.php/xxxx 就可以了,本着这个原则写他的规则。
PS: 顺便看了一眼 nginx 的规则,貌似和 apache 的差别很大。 我用nginx周一去单位 服务器上给你找 重写规则 我写过去掉index.php的重写 server {
listen 8080;
server_name **.cn;
root /home/wwwroot__old/;
access_loglogs/admin-access-logmain;
location / {
index index.php index.html;
rewrite ^/(.+)$ /index.php last;
}
location ~ .*\.php$ {
include conf/fastcgi.conf;
fastcgi_pass unix:/tmp/php-fastcgi.sock;
fastcgi_paramSCRIPT_FILENAME/home/wwwroot__old/$fastcgi_script_name;
}
} 挺像lighttpd的样子... 很不错滴,学习学习:) 看不懂:L 2# Hex
这里有详细说明:
http://blog.chinaunix.net/u/10668/showart_2042156.html 呵呵,你们的服务器很强大 server {
listen 8080;
server_name **.cn;
root /home/wwwroot__old/;
access_logl ...
zshtom 发表于 2008-5-12 18:15 http://codeigniter.org.cn/forums/images/common/back.gif
;P师傅你也在这啊!哈哈!
页:
[1]
2