伪静态在apache测试正常,但是在nginx中报505错误

问答中心分类: Nginx伪静态在apache测试正常,但是在nginx中报505错误
匿名用户 asked 8 年 ago
我本地使用的的thinkphp的.htaccess文件:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
服务器上使用的是:
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
在本地访问:http://domain.com/index.html 正常 (实际访问的是index.php/index.html);
上传到服务器上访问:http://domain.com/index.html
返回500状态码

1 Answers
oneinstack answered 8 年 ago
nginx和apache伪静态不一样,
如果nginx 绑定虚拟主机时:
./vhost.sh 选择伪静态选择thinkphp