tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: How to forward all kind of request from ROOT to another subdirectory?
Date Thu, 08 Dec 2011 17:18:19 GMT
Xybrek wrote:
> On Thursday, 08 December, 2011 09:37 PM, André Warnier wrote:
>> Xybrek wrote:
>>> On 12/8/2011 9:19 PM, Xybrek wrote:
>>>> On 12/8/2011 8:52 PM, Thom Hehl wrote:
>>>>> Simplest would be to set up an index.html in the root path that
>>>>> redirects to whatever you wish. You can find 500 hits on google about
>>>>> how to do an HTML redirect.
>>>>> -----Original Message-----
>>>>> From: Xybrek []
>>>>> Sent: Thursday, December 08, 2011 3:07 AM
>>>>> To:
>>>>> Subject: How to forward all kind of request from ROOT to another
>>>>> subdirectory?
>>>>> Hello,
>>>>> I need to forward all kind of request from the ROOT, i.e
>>>>> http://localhost:8080/ to http://localhost:8080/myRoot
>>>>> Is it possible, do I need to create a redirect servlet? However, I
>>>>> think
>>>>> tomcat can be configured to behave that way?
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>>> For additional commands, e-mail:
>>>> Hi, I am using UrlRedirectFilter.
>>> Also, I am able to redirect with UrlRedirectFilter from
>>> http://localhost:8080 to http://localhost:8080/myRoot
>>> However my problem now is that I want to keep the URL in the browser
>>> relative to the original ROOT, i.e. right now when I request for
>>> http://localhost:8080/index.html it will show
>>> http://localhost:8080/myRoot/index.html
>>> but I want to keep it like http://localhost:8080/index.html and for
>>> all other request.
>>> Maybe I need to do something with the rules in the urlrewrite.xml
>>> Any ideas?
>> Why do you not just rename "myRoot" to "ROOT", making this the default
>> application ?

> Hi Andre,
> Thanks. I know about placing the web app (like myRoot) under the ROOT 
> and it will work. However, there is another issue I that comes when I do 
> this, an issue with my GWT ( web app, 
> where the the client-side code cannot access the services (servlets).
> My gwt application works just fine in the myRoot folder of the tomcat 
> webapps folder. So my idea, is just forward every access to the ROOT to 
> myRoot.
> But then again, if there's a better solution I am may want to try it.
I don't think that I really understand the problem.
Let me re-phrase it, and you tell us if that is what you want :

I want that when a browser accesses the URLs :
"http://myhost:8080" or "http://myhost:8080/"
(and only for those 2 specific URLs),
it is redirected to "http://myhost:8080/myapp/".

And I want that for all URLs which start with :
they stay where they are (in "/myapp")

And I want that if they ask for
they really get "/something-else" from within the webapps/ROOT/something-else directory.

Is that what you want ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message