kenzeng 发表于 2008-5-9 11:38:16

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

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

null999 发表于 2016-7-13 11:03:24

le_el 发表于 2010-12-29 14:01
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;


是的,还是层主这个好

Hex 发表于 2008-5-9 16:29:50

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

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

zshtom 发表于 2008-5-10 14:48:42

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

zshtom 发表于 2008-5-12 18:15:12

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;
      }
}

xjflyttp 发表于 2008-8-28 13:06:13

挺像lighttpd的样子...

analyzer 发表于 2008-8-28 18:41:47

很不错滴,学习学习:)

lxylxy888666 发表于 2009-3-31 09:36:17

看不懂:L

liu1084 发表于 2009-9-2 13:43:48

2# Hex

这里有详细说明:
http://blog.chinaunix.net/u/10668/showart_2042156.html

sinopf 发表于 2009-9-2 15:28:49

呵呵,你们的服务器很强大

dogwin 发表于 2009-12-27 08:54:25

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
查看完整版本: 请问nginx服务器的去index.php的rewrite要怎么写?