Skip to main content
Participant
March 8, 2007
Question

Permit access to page using Domain

  • March 8, 2007
  • 5 replies
  • 660 views
Is there a way to seal off access to pages unless user is comming from specific Domain?
If so, and if this is generally a good idea, how?
    This topic has been closed for replies.

    5 replies

    Inspiring
    March 10, 2007
    you will always get only local (LAN) ip addresses then, if your clients
    connect to your site from their intranet, and most of those will likely
    be in the 127.0.x.x range (or other ip range reserved for local LAN use).
    i think you better store the client's zone in your db with the client's
    login details, and auto-redirect them after successful login to their
    zone...
    --

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com
    EINNAuthor
    Participant
    March 9, 2007
    Thanks dempster.
    I also got 127.0.0.1 from different location.
    Here is what I am trying to do:
    I have clients whith theyr own intranet using my webpages and the have to log in to get access.
    I want to put a link on theirs intranet pointing to a page on my web and that page auto log in to theirs zone depending on the domain they are comming from.
    (Excuse my English :)
    EINNAuthor
    Participant
    March 9, 2007
    cgi.REMOTE_HOST return only 127.0.0.1 and cgi.http_refferrer returns blank.
    Inspiring
    March 9, 2007
    You should get 127.0.0.1 if you're running it locally. Remote access should give an IP, although as monkey woo too noted it can be spoofed.

    Maybe you should explain what you're trying to do. There could be other approaches.
    Inspiring
    March 8, 2007
    You could use CGI.http_referrer, but keep in mind that variable is only set to a value when a user actively follows a link to your site. It is often blank if a user book marks your site, enters in the URL directly, or is using an uncommon web browser. Are you expecing users to come from another domain to your site, or are you trying to limit a page on your site to just users who are already on your site?
    Inspiring
    March 8, 2007
    A better variable to use is CGI.REMOTE_HOST which should give the IP address of the user's computer. You could use this to restrict access to specific IP ranges for CFM pages. There are often better ways to do this through your web server admin controls - it could protect all pages (cfm and html) in a directory.