Forums Register Login

redirection is going to infinite loop if url is not having the www domain

+Pie Number of slices to send: Send
Hi All,
Facing strange problem in our production environment that is redirecting the url is not working if the domain is not having www in the url.

here is the example:

we have one index.html file having the switch function for redirecting the curHost to specific action class and what action class will do is getting the domain(current host) and ip address of user and then read the properties file for getting the target url based curhost.ipaddress.

here the problem is ,if we enter http://chevroletarabia.com it is not working and if we enter like http://www.chevroletarabia.com then it is working fine.

what could be the problem can any one help me on this.

sample of index.html,propertiesfile:

IP REDIRECTION Action:
code snippet of perform method:

properties file:

can you please any ne help on this

Thanks & Regards
Vasu

[Edit by Dave to add code tags]
[ December 23, 2005: Message edited by: David O'Meara ]
+Pie Number of slices to send: Send
have you tried opening the URL without the www in a browser? If the redirection is happening on the server (eg being sent a 301 or 302 response code) you will need to take that into account in your code.
+Pie Number of slices to send: Send
Hi
it is working for http://www.chevroletarabia.com and for http://chevroletarabia.com it is not working and going to infinite loop.
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1005 times.
Similar Threads
How to get client's IP address, Domain using Java
NullPointerException Trying to Get RemoteIP (why?)
Look up fails twice then works fine??!
how to identify which button is pressed in struts!!!
Calling a JSP from a Javascript
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:29:19.