• 请不要在回答技术问题时复制粘贴 AI 生成的内容
dsfdter
V2EX  ›  程序员

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

  •  
  •   dsfdter · Jun 27, 2017 · 7918 views
    This topic created in 3270 days ago, the information mentioned may be changed or developed.

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

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

    这个如何写? nginx

    2 replies    2017-06-27 23:01:03 +08:00
    okletswin
        1
    okletswin  
       Jun 27, 2017
    nginx if 是个坑,代码可控的话直接在程序里做重定向嘛
    sparkssssssss
        2
    sparkssssssss  
       Jun 27, 2017 via iPhone   ❤️ 1
    直接 location 就搞定了
    location = /index.php?xxxxxxxxxxx {
    return 301 xxxxx.com/abc.html;
    }
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5489 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 05:50 · PVG 13:50 · LAX 22:50 · JFK 01:50
    ♥ Do have faith in what you're doing.