V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dsfdter
V2EX  ›  程序员

nginx 如何指定链接跳转到其他页面

  •  
  •   dsfdter · 2017-06-27 18:15:22 +08:00 · 7508 次点击
    这是一个创建于 2505 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如这个链接 /index.php?route=product/category&path=

    我只想把访问这个链接的用户就跳转到 /abc.html 页面

    这个如何写? nginx

    2 条回复    2017-06-27 23:01:03 +08:00
    okletswin
        1
    okletswin  
       2017-06-27 18:42:28 +08:00
    nginx if 是个坑,代码可控的话直接在程序里做重定向嘛
    coolloves
        2
    coolloves  
       2017-06-27 23:01:03 +08:00 via iPhone   ❤️ 1
    直接 location 就搞定了
    location = /index.php?xxxxxxxxxxx {
    return 301 xxxxx.com/abc.html;
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5291 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:48 · PVG 17:48 · LAX 02:48 · JFK 05:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.