I wanted to simply redirect users accessing our sametime server to separate html pages I had created that allow increased accessibility to internal employees(stinternal.html), and a more restrictive page for external attendees, (stexternal.html). Not a big deal the stexternal is a version which only allows the user to either register with the site or attend a meeting.
So I created a form in the stcenter and positioned it to open when the database was accessed. The home url for domino points to the stcenter.nsf database in the server document, so we are fine. I wrote some simple javascript and placed it in the html head, to assign the cgi variable “Remote_Addr” to a string. In the JS header, I am retreiving that string and redirecting based upon the first two octets, which will always be in my case “12.26” for those accessing the server from anywhere within the organization. So, if the ip addy of the requester contains the above, like so:
if (ipstring.IndexOf(“12.26.”) == -1)
where ipstring is the variable that now contains the Remote_Addr field contents, redirection to stinternal.html will occur.
So, the redirection condition is applied…else it goes to the stexternal.html page. Easy enough. But everything is dependant upon the Remote_Addr field.
The field was consistently returning the IP address of the server as assigned via AT&T. They have designated a set of IP addresses for us, and bind DNS names accordingly upon request. That is in a nutshell how we host all of our webservers while keeping them physically onsite. Anyway, I tried many variations of the above with the same result.
Then I decided to simply write a quick Java Servlet, compile it and place it into the Domino Servlet directory. The servlet uses the getRemoteAddr() method of the ServletRequestWrapper class. Guess what? Same result.
At this point, I have decided to base the redirection upon a field within the person documents of the domino directory…this is actually more efficient since internal users on the road should be redirected to the same stinternal.html page regardless of their location.
But I am still working on resolving the issue, as it is a learning experience if nothing else. I am thinking it must be an issue of some proxy configuration with AT&T. I am also thinking that the field itself is working as it should, but why the IP of the server? Any insight via similar previous experience or whatever would be appreciated.