【发布时间】:2018-11-26 17:29:18
【问题描述】:
如何创建具有 url 参数的重定向?
例如,我需要:
/testing/?id=123 重定向到/testing/123
我试过了
rewrite ^/testing/?id=(.*)$ /testing/$1 redirect;
但我只收到404。
如果我不使用 url 参数而只是执行类似的操作
rewrite ^/testing/(.*)$ /anothertest/$1 redirect; 有效。
【问题讨论】:
标签: nginx