If web services are configured for an internal network, where all the machines are member of the same DNS domain, you can easily reach all the web services by only specifying the host name in the browser, without specifying the domain name.
The Access Gateway requires you to specify the domain name when trying to reach the accelerated web service - otherwise, you'll receive an error from the Access Gateway. With some easy modifications to the error page, you can redirect a browser that is accessing the web service by specifying only the host name to the full domain name.
Figure 1 - Error: "Host name received is not for this web site"
For this example, we'll use "nam3-lab.lab.ba" as the full domain name. The host name in the example is "nam3-lab", and the domain name is "lab.ba". This example will show how to modify the error page. It contains some reference code that can be changed according to your preferences.
First, you need to locate the error page. You can find this on the Access Gateway servers in this folder:
The error page is called "error.jsp".
Use the following three steps to modify the error page:
1. Add Java code to the jsp page to detect if the error is caused by host name mismatch and that the browser is using only host name to connect.
String onload = "";
String host = "";
if(statusCode.matches("403") == true)
onload = "";
host = request.getServerName();
String isFullName = host.indexOf(".")+"" ;
if(isFullName.equals("-1") == true)
onload = "redirect()";
The browser will call this script when a redirect to the full domain name is needed. The host name is derived from the browser request, and the domain name is defined statically in the script.
3. Change the body to include the onload event:
<body leftmargin="0" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0" onload="<%=onload%>">
When users now accesses http://nam3-lab, they will be automatically redirected to http://nam3-lab.lab.ba, and the error message will not displayed.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.