Link to home
Start Free TrialLog in
Avatar of Jeex
JeexFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Relative redirects: Tomcat 5 using machine local hostname instead of the FQDN from the request

Hi,

I have a Jakarta Tomcat 5 server installed on a Windows 2003 Server machine (hostname labsweb1). There is a DNS entry for www.ourcompany.com pointing to the ROOT webapp on the labsweb1 server. When I go to http://www.mycompany.com/about/ for example, I get the same page as http://labsweb1/about/, except that in the web browser the URL remains http://www.mycompany.com/about/

However, if an HTTP redirect header is sent, for example from http://www.mycompany.com/goto.jsp?page=about then the URL becomes http://labsweb1/about/ instead of http://www.mycompany.com/about/

From what research I've done, this is because Tomcat is by default configured to use the machine's local hostname for resolving redirects, instead of the FQDN from the request. Any idea how to configure Tomcat so that it uses the FQDN from the request for relative redirects?

Please help if you can, thanks in advance!

-- James
ASKER CERTIFIED SOLUTION
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeex

ASKER

Thanks for your help, R.K. - sorry for not accepting your answer earlier!

-- James
Hi,

No problem ... anyway you got your solution...Good..

Best of luck..

R.K