holinhot
V2EX  ›  问与答

nginx rewrite 问题

  •  
  •   holinhot · Dec 24, 2015 · 1535 views
    This topic created in 3886 days ago, the information mentioned may be changed or developed.

    www.q.com
    location / {
    rewrite ^/(.*)$ http://www.b.com/ redirect;
    }
    配置上这一段后当访问
    访问 http://www.a.com/ 的时候自动转到 http://www.b.com/

    可是当访问 http://www.a.com/?test 的时候会转到 http://www.b.com/?test

    如何配置不管访问 http://www.a.com/ 加什么都转到 http://www.b.com/
    如:
    http://www.a.com/safa/
    http://www.a.com/asjfo
    http://www.a.com/?fljofr
    http://www.a.com/?lfj3/
    http://www.a.com/ljfsf?/
    http://www.a.com/lsdf?
    都转到 http://www.b.com/

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2790 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:13 · PVG 21:13 · LAX 06:13 · JFK 09:13
    ♥ Do have faith in what you're doing.