【发布时间】:2017-08-18 06:01:21
【问题描述】:
我在带有 php5-fpm 的 Ubuntu 10.4 上使用 NGINX 1.2.3。
http://example.com/step2.php?qid=RAUVGXF
我想重写
/step2.php?qid=RAUVGXF
作为
/step2/RAUVGXF
我该怎么做?
我的部分 NGINX 配置如下:
root /var/www;
location ~ .php$ {
fastcgi_param HTTPS on;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
}
【问题讨论】:
-
要确认,您想浏览到
http://www.example.com/step2.php?qid=RAUVGXF并实际加载资产/step2/RAUVGXF正确(这与大多数人尝试做的相反)? “RAUVGXF”是脚本、静态资产还是什么?您希望浏览器窗口中的 URL 更改,还是保持为http://www.example.com/step2.php?qid=RAUVGXF?
标签: php nginx url-rewriting args