male110
V2EX  ›  问与答

问个 url 重写的问题

  •  
  •   male110 · Jun 29, 2018 · 2360 views
    This topic created in 3038 days ago, the information mentioned may be changed or developed.

    比如一般 http://xxx.com/article/index 对应的是 articleController,index 方法。 现在是在 http://xxx.com/dir/article/index 现在又多了一层目录 dir 这时 url 重写规怎么写? Nginx 怎么做? Apache 怎么做?

    1 replies  •  2018-06-29 13:25:24 +08:00
    xiaoxinshiwo
        1
    xiaoxinshiwo  
       Jun 29, 2018
    dir 这一层就是 contextPath 了吧? tomcat server.xml 可以设置的啊,nginx 设置转发就好了吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1254 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    ♥ Do have faith in what you're doing.