Redirect based on hostname & port

This is a pretty basic question I expect. Though not being Java developer, I'm at an impass.

I have a small piece of Java code running on a proxy device that runs a basic IF / THEN routine as follows:

if (location.hostname == "testmachine.domain.com")

{

location = ("http://www.newwebpage.com/sorry.html");

}

Very simple stuff. But I'd like to include a port number as well. Essentially I need to combine the above to include a non-standard port like 8500 so that the routine reads:

if (location.hostname == "testfailover.domain.com")

and port number 8500

{

location = ("http://www.newwebpage.com/sorry.html");

}

I cant' get the syntax right. Actually I don't know that it's possible at all. Does anyone have any suggestions or a good reference site that they can suggest? Thanks in advance.

[889 byte] By [SecAdmina] at [2007-11-27 2:53:12]
# 1
The first thing you need to determine is whether you are dealing with Java or JavaScript. Those are two different programming languages...
sjasjaa at 2007-7-12 3:27:56 > top of Java-index,Core,Core APIs...