【发布时间】:2014-07-26 22:33:33
【问题描述】:
好的,我现在在 apache 中进行了设置
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !favicon.ico$
RewriteRule .* index.php/$0 [PT]
我有像http://addr.tld/index.php/site 这样的网址,它适用于 apache。
我试图在 nginx 中重现它
root /home/maciekmm/www;
index index.php;
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php/$1;
}
try_files $uri $uri/ =404;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
但我明白了
处理时重写或内部重定向循环“/index.php//index.php//index.php//index.php//index.php//index.php//index.php//index.php //index.php//index.php//index.php//about-me"
我应该怎么做才能像在 apache 中那样重定向 url?
我旁边有一个 php 路由器,但为了测试我禁用了重定向,所以它只是打印目标。
【问题讨论】: