[英]Removing all GET parameters for redirect
我想使用Nginx将以下网址重定向到首页
https://www.example.com/old.php?u=BUH09MrRGtnYWB2Nc5CGcX879Y6wqF5EDTij6vphybUekhzY0Qo%3D&b=5
上面的网址应重定向到https://www.example.com/
我正在使用以下规则
rewrite ^/old.php(.*)$ https://www.example permanent;
重定向到首页的作品,但我看到了
https://www.example.com/?u=BUH09MrRGtnYWB2Nc5CGcX879Y6wqF5EDTij6vphybUekhzY0Qo%3D&b=5
而不是地址栏中的https://www.example.com/
根据http://wiki.nginx.org/HttpRewriteModule#rewrite ,您只需要添加一个? 重写结束时:
rewrite ^/old.php(.*)$ https://www.example? permanent;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.