扫码关注官方订阅号
譬如我要重写以下路由:/user?id=55/question到/dispatch这个地方,要怎么写呢?
小伙看你根骨奇佳,潜力无限,来学PHP伐。
location /question/ { rewrite ^/question(.*) /dispatch$1 last; } location /user/ { if ($query_string = "id=55") { rewrite ^/user(.*) /dispatch$1 last; } }
location /question/ {
rewrite ^/question(.*) /dispatch$1 last;
}
location /user/ {
if ($query_string = "id=55") { rewrite ^/user(.*) /dispatch$1 last; }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
location /question/ {
}
location /user/ {
}