账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    nginx rewrite /test.php/xxx/yyy ---> /test.php/yyy ?
    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/yyy to /test.php/yyy and also includes an additional query parameter ? at the end. Here's a breakdown of what's happening:

      • &&gt: 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/yyy matches 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/yyy with the query parameter ?, Nginx will redirect the user to /test.php/yyy with the additional query parameter ? and the requested path /test.php/xxx/yyy.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部