伺服器使用一鍵lnmp安裝的,開啟了pathinfo模式後發現使用header跳轉時index會被過濾。
使用的是TP系統,U方法與header location之後會出現這種情況,
#如`http://xx.com/index.php/a/b` 會變成`http://xx.com/.php/a/b`,而網址列輸入沒有問題
貼上設定檔
1 、網站conf
```
server
# {
listen 80;
# listen 80;
#listen [::]:80;
server_name xx.com ;
index index.html index.htm index.php default.html default.htm default.php;
#.php;
# root /data;
#error_page # 4041##/40 #error_page # 404 #1/40442##.
## #include enable-php.conf;
include enable-php-pathinfo.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
#}
location ~ .*\.(js|css)?$## {
# 11
location ~ /.well-known {
# allow
# allow
#
location ~ /\. {
deny );
{
fastcgi_
# # }`````
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#fastcgi_param QUERY_STRING meth _$Dhquery_strment_param QUERY_STRING meth _METmHOquery_str。 ##fastcgi_param CONTENT_TYPE $content_type;
fastcgi_?
##fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
##fastcgi_param SERVER_PROTOCOL $server_protocol;##sche_#歐以外3% REsche_m HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;# fastcgi_param remote_addr $ remote_addr;
#addr $
# 只適用於PHP,如果PHP 是使用--enable-force-cgi-redirect 建構的,則需要
fastcgi_param REDIRECT_STATUS 200;
#fastcgi_? ##4、pathinfo.conf
ringa_lee2017-09-01 09:25:56
index index.html index.htm index.php default.html default.htm default.php;
你把前面的index去掉