1
這裏是我重寫代碼:如何讓nginx的rewrite a.php只會,b.php,c.php到的index.php
location/{
if (!-e $request_filename){
rewrite "(*UTF8)^/(.*)$"/last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/";
}
我想重寫a.php只會,b.php,c.php到/index.php.but它不起作用!但是當我鍵入一個.c,上面的代碼可以工作,我犯了一些錯誤?
嘗試'重寫^(。*)$ /index.php最後;'' –