首页 >
web >
nginx
nginx特殊字符的rewrite
时间:2018-02-02 18:00:20 点击: 来源: 作者:
原地址:
borrowinfo.page?borrow_id=2017121500000000000000005173
目标地址:
/invest/info?borrowId=2017121500000000000000005173
if ($request_uri ~* "^/borrowinfo.page/?borrow_id=(/d+)$") {
...
原地址:
borrowinfo.page?borrow_id=2017121500000000000000005173
目标地址:
/invest/info?borrowId=2017121500000000000000005173
if ($request_uri ~* "^/borrowinfo.page/?borrow_id=(/d+)$") {
set $myarg $1;
rewrite .* https://www.domain.com/invest/info?borrowId=$myarg? permanent;
}
说明:$1不可直接使用,不然会不生效;
域名改成自己的;
”您可通过以下微信二维码,赞赏作者“