【发布时间】:2015-11-15 02:09:14
【问题描述】:
我正在使用 nginx 将 URL 像http://www.sample.com/application 重写为 http://www.sample.com/index.php/application
重写规则是
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 break;
}
我的 fastcgi 配置是
location ~ \index.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
但是重写规则不起作用。
我浏览 http://www.sample.com/index.php/application 也不起作用。/application 没有传递给 index.php
这有什么问题?
【问题讨论】:
标签: php .htaccess nginx url-rewriting