Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I setup 301 redirects on Apache Tomcat that uses Sessions

Status
Not open for further replies.
May 30, 2004
15
0
0
US
Hello. Thanks everyone in advance for your help.

My goal is to search engine optimize our website. I am having trouble setting up a 301 redirect for an area of our website that requires sessions.

Our website architecture uses Apache Tomcat (the application server) with IIS 6.0 and Helicon 3.0 up front as the web server.

At one point we used to set our sessions via a JSESSIONID in the URL. We removed the session from the URL because apparently search engine bots see each session as a completely different page (e.g. and and are all viewed as different pages)

With the JSESSIONID out of the URL, our Application server has a problem in determining what the client's session is, because of the cookie behavior.

In the first request to Tomcat from a client, a JSESSIONID is assigned and sent back to the browser with a redirect. The browser, if it accepts cookies, sets the cookie and sends it back when it follows the redirect. If the browser (or robot) does not accept cookies, there is the potential to enter a loop - because the JSESSIONID cookie is never sent back to the application server - the application server will continually resend JSESSIONID cookies, in an attempt to get a session setup.

Does that make sense? Please let me know if I need to clarify anything or provide additional details. I appreciate your help.
 
Possibly using apache mod_rewrite with the Passthrough flag? I think it should rewrite the URL in the browser, but pass through the original request.

RewriteEngine on
RewriteRule ^/test\.html;JSESSIOND=.* /test.html [PT]

Rob



Rob Jordan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top