查看完整版本: 请问nginx服务器的去index.php的rewrite要怎么写?

kenzeng 2008-5-9 11:38

请问nginx服务器的去index.php的rewrite要怎么写?

我服务器用的是nginx,用帮助里写的那种规则没效。。

Hex 2008-5-9 16:29

楼主应该参考 nginx 的 rewrite 规则。
最主要的就是要实现把 [url]www.domain.com/xxxx[/url] 映射成 [url]www.domain.com/index.php/xxxx[/url] 就可以了,本着这个原则写他的规则。

PS: 顺便看了一眼 nginx 的规则,貌似和 apache 的差别很大。

zshtom 2008-5-10 14:48

我用nginx  周一去单位 服务器上给你找 重写规则 我写过去掉index.php的重写

zshtom 2008-5-12 18:15

server {
    listen 8080;
    server_name **.cn;
        root /home/wwwroot__old/;
    access_log  logs/admin-access-log  main;
        location / {
        index index.php index.html;
                rewrite ^/(.+)$ /index.php last;
        }
        location ~ .*\.php$ {                           
        include conf/fastcgi.conf;
            fastcgi_pass   unix:/tmp/php-fastcgi.sock;
                fastcgi_param  SCRIPT_FILENAME  /home/wwwroot__old/$fastcgi_script_name;
        }
}

xjflyttp 2008-8-28 13:06

挺像lighttpd的样子...

analyzer 2008-8-28 18:41

很不错滴,学习学习:)
页: [1]
查看完整版本: 请问nginx服务器的去index.php的rewrite要怎么写?