File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Redirect a URL

gagan ranade

Joined: Dec 09, 2008
Posts: 2
Hi All

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

I have two different URL's. (Old URL) and (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

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

Joined: Dec 09, 2008
Posts: 2
Is it something that we can configure in web.xml or server.xml?
I agree. Here's the link:
subject: Redirect a URL
It's not a secret anymore!