On Friday, 09 December, 2011 01:18 AM, André Warnier wrote:
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 [mailto:xyb...@gmail.com]
Sent: Thursday, December 08, 2011 3:07 AM
To: users@tomcat.apache.org
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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

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 ?
http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F




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 (http://code.google.com/webtoolkit/) 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 :
http://myhost:8080/myapp
they stay where they are (in "/myapp")

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

Is that what you want ?

Hi Andre,

For "/somethingelse" yah that's what I mean. Every access to "http://myhost:8080"; will be "forwarded" to http://myhost:8080/myapp

Like if request is: http://myhost:8080/something.html, it will forward it to http://myhost:8080/myapp/something.html

Or request like: http://myhost:8080/?q=test will be forwarded to http://myhost:8080/myapp/?q=test

Is it possible?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to