简体   繁体   中英

url path issue after deployment on apache tomcat 8.0

i have deployed a website on apache Tomcat server 8.0 (lets suppose the folder name is WebsiteFolderName) in the form of war file. when i access the website by url [www.example.com] , my site redirects to [www.example.com/login.jsp] and then gives me a invalid path error.

But when i access the site using [www.example.com/WebsiteFolderName] , my site redirects to [www.example.com/WebsiteFolderName/login.jsp] and then login page works fine but rest of my website pages also face this path issue.

what should i do so that i can access my website using www.example.com instead of http://www.example.com/WebsiteFolderName

You got two easy options:

  1. Do not change your war file name and configure conf/server.xml with details about your war file.

<Context path="" docBase="your_war_file" debug="0" reloadable="true"></Context>
  1. Rename your war file to ROOT.war

Option 2 is easier, but option 1 is easier for fast deployment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM