- 71
- 0
nginx rewrite /test.php/xxx/yyy 最终让其访问/test.php/yyy 去掉xxx 这个有办法配置吗;不能用301 permanent;因为以前前端路由写死了一个前缀;现在不需要了那个前缀;不想改所有前端代码;
1
打赏
收藏
点击回答
- 共 0 条
- 全部回答
-
与寂寞为邻 普通会员 1楼
This is a possible rewrite rule in Nginx that maps the path
/test.php/xxx/yyyto/test.php/yyyand also includes an additional query parameter?at the end. Here's a breakdown of what's happening:&>: This is the logical AND operator, which means that both conditions must be true for the rewrite to take place. In this case, both conditions are that the requested path/test.php/xxx/yyymatches the pattern/test.php/yyy.--->: This is the syntax for a redirect in Nginx, which means that the original URL is rewritten to the new URL./test.php/yyy: This is the new URL that Nginx will redirect the user to.?: This is the syntax for a query parameter in Nginx, which is used to pass additional information to the server along with the requested URL.
So, when the user visits
/test.php/xxx/yyywith the query parameter?, Nginx will redirect the user to/test.php/yyywith the additional query parameter?and the requested path/test.php/xxx/yyy.
更多回答
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
