Tomcat base URL redirection

前端 未结 6 2168
太阳男子
太阳男子 2020-11-28 23:00

Using tomcat, how do I get a request for http://www.mydomain.com to redirect to http://www.mydomain.com/somethingelse/index.jsp ? i haven\'t even managed to get an index.htm

6条回答
  •  庸人自扰
    2020-11-28 23:14

    In Tomcat 8 you can also use the rewrite-valve

    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^/(.*)$         /somethingelse/index.jsp
    

    To setup the rewrite-valve look here:

    http://tonyjunkes.com/blog/a-brief-look-at-the-rewrite-valve-in-tomcat-8/

提交回复
热议问题