[英]URL forwarding in deploying tomcat web application
I have tried to look if this question was asked before but I couldn't find an answer. 我试图看一下是否曾问过这个问题,但找不到答案。 I want to deploy tomcat web application, let's call it X. Now when I type URL on the browser, say www.example.com/X, the project is deployed successfully. 我想部署tomcat Web应用程序,我们称之为X。现在,当我在浏览器中键入URL,例如www.example.com/X时,项目已成功部署。
But I don't want a user to go through all of that. 但是我不希望用户经历所有这些。 What I want to achieve is that a user has only to type www.example.com then he will be automatically directed to www.example.com/X. 我要实现的是,用户只需键入www.example.com,然后他将被自动定向到www.example.com/X。 Can I configure this in the server? 我可以在服务器中配置它吗? or what is the convenient way to go with it? 或便捷的方式是什么?
This is achieved with the Server.Service.Engine.Host.Context
element in conf/server.xml 这是通过conf / server.xml中的Server.Service.Engine.Host.Context
元素实现的。
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
<Context docBase="C:\\Program Files\\Apache Software Foundation\\apache-tomcat-6.0.37\\webapps\\X" path="" reloadable="true" />
Add the configuration, then restart the tomcat server. 添加配置,然后重新启动tomcat服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.