大神们,今天我上线一个项目出现了点问题,就是主页能显示,跳转都是404,我知道是nginx中的rewrite的问题,请问大神3.2.2中nginx配置里面的rewrite规则应该怎么进行配置啊,这个问题卡了好久,url怎么才能重定向。

解决方案 »

  1.   

    比如这样的网址
    http:://www.test.com/mall/product/1.htmllocation / {
    rewrite ^([^\.]*)/(\w+)/(\w+)/(\w+)\.html$ $1/?m=home&c=$2&a=$3&id=$4 last;
    }
    访问的就是 home模块,mall控制,product方法,id 参数是 1
      

  2.   

           location /{
                   index index.html index.htm index.php;
                   if (-e $request_filename) {
                           break;
                   }
                   if (!-e $request_filename) {
                           rewrite ^/(.*)$ /index.php/$1 last;
                           break;
                   }
           }
    为何项目都上线了,还不知道如何配置?
      

  3.   

    我的网站现在可以跳转了,但是除了主页,其他页面所有的样式都不好使了,ajax也坏掉了,生无可恋了求大神加下我的QQ可以帮我我这个新手一下,我很着急啊!!!QQ964901822