【发布时间】:2016-03-31 07:03:37
【问题描述】:
如何更改 url 中的参数
例如 https://example.com/r.php?12345 到 https://example.com/12345 ?
nginx 配置文件:
server {
listen 80;
server_name example.com;
rewrite_log on;
# note that these lines are originally from the "location /" block
root /usr/share/nginx/example.com;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
以及在哪里添加块 在conf文件里面?
【问题讨论】:
标签: mod-rewrite nginx