nginx偽靜態求助 感謝
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
###########################華麗麗的分界線#################
#上面是原來htaccess中的url重寫配置(apache環境),thinkphp項目,有xx、yy、zz三個分組,xx是預設分組
#下面是我要配置的虛擬機器
##########################################################
server {
listen 80;
server_name www.aaa.com;
location / {
root E:/webroot;
index index.html;
includefastcgi_params;
rewrite ^(.*)$/index.php?$1 last;
}
error_page404 = http://www.aaa.com/error404.html;
location ~ \.php$ {
rootE:/webroot;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.html;
fastcgi_paramSCRIPT_FILENAME E:/webroot$fastcgi_script_name;
includefastcgi_params;
}
}
搞了一下午,無論訪問www.aaa.com/yy 還是訪問www.aaa.zz, 其實都指向了預設的xx分組
崩潰 求助 感謝
分享到:
------解決方案--------------------
#把所有來源解析到index.php
rewrite ^(.[^~]*)~(.*)$ /index.php?mod=$1&action=$2 last;
例如
http://7di.net/a~b 會解析到 http://7di.net/index.php?mod=a&action=b
------解決方案--------------------
引用:
感謝樓上 已經搞定:
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
請結貼