Coldfusion - determine if site is being accessed through intra or extranet

235 Views Asked by At

I have a simple question (I think!). I have a hyperlink on my CF site that needs to be different if the site is being accessed through our intranet or out in the field, through our extranet.

How can I determine this in Coldfusion? I just need to change the hyperlink to https if the site is being accessed through our extranet.

Thank you

2

There are 2 best solutions below

0
On

I'd agree with Neokoenig - why give yourself the problem of choosing when to serve HTTP/HTTPS - unless you serve them on different domain names, and you don't want to pay for 2 SSL certificates.

Depends upon how you allow access to the intranet however - are you checking the IP address of the user for an internal IP to serve up intranet) or just detecting the URL that they used to access it (e.g. "intranet.company.com" or "extranet.company.com") for the application to understand what type of application it is serving up?

Either way, try dumping the CGI struct to see the various server variables available to you.

0
On

If your whole intranet is behind a proxy, CGI.REMOTE_ADD can you help in achieving this, because CGI.REMOTE_ADD will return address of proxy server and you can identify user with this.