2012-01-31 43 views
0

任何人都可以幫助我重寫URL,我想從使用nginx的

http://localhost/auditsi/cms3/index.phpdirMod=jobseeker&dirAct=myaccount&dirPref=view_front&dirMn=lWU=

重寫URL來

http://localhost/auditsi/cms3/jobseeker/myaccount/view_front/lWU=

其中/auditsi/cms/是目錄。

我改寫這裏:

location/{ 
     } 

    location /auditsi/cms3/ { 
     index index.php index.html; 
     rewrite ^(.*)/(.*)/(.*)$ /index.php?dirMod=$1&dirAct=$2&dirPref=$3 break;    
    } 

我已經從維基nginx的學習,但從來沒有succses :(

請幫我

+0

你不是在原來的網址忘記了一個問號,你有沒有 – 2012-01-31 15:34:41

+0

ops..sorry我錯了良好的網址是http://本地主機/auditsi/cms3/index.php?dirMod=jobseeker&dirAct=myaccount&dirPref=view_front&dirMn=lWU=但我的問題是相同:( – 2012-02-02 09:56:37

回答

0

請試試這個:

server { 
    rewrite ^/auditsi/cms3/(.*)/(.*)/(.*)$ /index.php?dirMod=$1&dirAct=$2&dirPref=$3 break; 

    location { 

    } 

    location /auditsi/cms3/ { 
      index index.php index.html; 

    } 
.... 
+0

它的工作,但只能訪問http://本地主機/ auditsi/CMS3 /求職/我的帳戶/ view_front不是http: //本地主機/ auditsi/CMS3 /求職者/我的賬戶/ view_front/LWU = – 2012-02-02 02:01:12