We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Create A Centralized Redirect Using JSP

kirbinator
kirbinator asked
on
Medium Priority
286 Views
Last Modified: 2010-04-01
Problem:
We have recently redesigned/reorganized our website (approximately 60,000 pages, http://www.wicourts.gov).  We have a large user base (basically the entire state of Wisconsin), who have bookmarked various pages on the old website.  As a courtesy to our customers, we want to have a centralized redirection system, that way we don't have to create a zillion different redirection pages.  In addition, we want the user to know that the page no longer exists and that they are being redirected to a new page (thus giving them the opportunity to update their bookmarks).

Possible Solution:
One solution that I have come up with is having one JSP page that accepts 2 parameters (the original page and the new page).  Since we are using Apache, we can setup redirects for a particular page that redirects the user to the JSP page (obviously passing the appropriate parameters), waits 5-10 seconds, and then sends them to the appropriate page.  The parameters will be used to display information back to the user and assist in redirecting to the new page (I hope that makes sense).

The Challenge:
Although the solution above might work, I wanted to pose the question to this community to get some various feedback.  I could very well just do a simple redirect using Apache and be done with it, but that does not prompt the user to update their bookmarks.  I could have also created the zillion pages and do the redirect that way as well... but that would be very labor intensive.  Has anyone else had to do something similar?  If so, how did you accomplish the task?

The best response get the max points...
Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
the approach you are proposing sounds reasonable. How are u storing the redirect mappings?

Author

Commented:
I was just going to add the redirects in the query string within the httpd.conf file.  Something like this

Redirect "/somedir/index.html" "/redirect.jsp?referring=/somedir/index.html&new=/newdir/index.html"

Do you know (or think) of a better way?

Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
One option, if you are using is, that you can keep a redirect map either in memory or the DB.

Remove all the old files from the system, and in the web.xml, for a 404 error forward the request to the redirect JSP that will check whether .. the requested url is an old url or not.

If it is an old URL, you can redirect it to the correspoding new page using the redirect map, or else you can display the 404 error. :)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.