0

I have a file present at location Webapps/MyApp/Web/index.html in tomcat.

If I use following URL I am able to access it: :/MyApp/Web/index.html

I want to use one more URL to access this location: :/MyApp/Strom/Web/index.html

The Strom directory does not exist in my webapp and i dont want it to exist, I only want to redirect the URL of Strom to Web.

How can I achieve this in tomcat by setting context path?

I tried setting context path in server.xml under host tag.

But it didnt work.

kshitij
  • 1
  • 2
  • You want both URLs to give you the same resource? Or do you want to change the context-path of the application so that you must use `/MyApp/Strom/Web/index.html` to access the resource instead of `/MyApp/Web/index.html`? – Christopher Schultz Jul 20 '19 at 00:31
  • I want both URLs to give the same resource. ie. in webapp the resource consists at location x hence if i access x from url i am able to get x. But I want another URL y that should give me resource present at x. – kshitij Jul 31 '19 at 06:31
  • You cannot achieve this by setting the context path (only). You will need to perform some kind of url-redirection within your web application. Would forwarding `/MyApp/Strom/Web/index.html` to `/MyApp/Web/index.html` (and possibly others as well) meet your requirements? – Christopher Schultz Aug 02 '19 at 13:01

0 Answers0