my dog learned polymorphism*
The moose likes Tomcat and the fly likes Redirect a URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect a URL" Watch "Redirect a URL" New topic
Author

Redirect a URL

gagan ranade
Greenhorn

Joined: Dec 09, 2008
Posts: 2
Hi All

I have a very simple request but dont know how to do...

Requirement:
I have two different URL's. http://myapp.com (Old URL) and http://mynewapp.com (NEW URL)

What I want is if a user enters OLD URL in the browser, it should automatically change to NEW URL.

I want to do the same in two different environments:
1. Apache 3.0 (tcl script)

2. Tomcat 5 (servlet, JSP)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In Tomcat, simply create an application that redirects all requests to the new URL using response.sendRedirect.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
gagan ranade
Greenhorn

Joined: Dec 09, 2008
Posts: 2
Is it something that we can configure in web.xml or server.xml?
 
jQuery in Action, 2nd edition
 
subject: Redirect a URL