69 users online (0 members and 69 guests)  


  Results 1 to 7 of 7

Related

  1. PR0 (new) site, looking for link exchange    Forum: Link Exchange
    Replies: 0
  2. several people cannot access my site    Forum: PHP Forum
    Replies: 1
  1. #1
    chimoong's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Bar Access to a Site except a Link from another Site

    Let say, make it simple, my domain name is abc.com, when people click a hyperlink in the abc.com, it will go to abc.com/123.html. Can I restrict the visitor, ie they can only visit the abc.com/123.html through clicking the hyperlink at abc.com ? I mean, the visitor cannot go directly into abc.com/123.html, just by keying in the abc.com/123.html at their search box (toolbar).

    Let me tell you my intention behind. My main page is abc.com, which is an opt-in page to capture visitors' database. There is a link at the abc.com to abc.com/123.html. Then at the abc.com/123.html, there are good stuffs for people to download free. In order to prevent people just copy the link abc.com/123.html and paste it into their emails (send to thier friends), then I have to do something on the protection, ie bar people directly access into abc.com/123.html. if visitors want to access into the abc.com/123.html, they have to key in their database at abc.com.

    What is the script (should be pasted at the abc.com/123.html) ? I need it.

  2. #2
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Bar Access to a Site except a Link from another Site

    I think you might want to google ".htaccess" for this.
    I know the basic theory, but I'm crap at explaining it because I've never used it!
    Your host may have other options to restrict access, too.

  3. #3
    chimoong's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Re: Bar Access to a Site except a Link from another Site

    Thank you for your comment.
    Instead of using "htaccess", do you have any script to carry out this task ? Pls advise.

  4. #4
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Bar Access to a Site except a Link from another Site

    Not in html.
    If you've got access to a server-side language (such as php) and a database there are thousands of ways, but without knowing what facilities your host offers, it's impossible to advise.

  5. #5
    chimoong's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Re: Bar Access to a Site except a Link from another Site

    Dear DeadMeatGF, I really appreciate your advice on the server-side language (such as php). Haha, I can say, this is beyond my knowledge to understand this.
    I posted my problem in the forum, intended to get a solution for a simple layman like myself. The best is to use the most traditional way, ie cut & paste the code, that's all.
    Seems I need to give up.

  6. #6
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Bar Access to a Site except a Link from another Site

    It's not that you need to give up, it's just that you can't do it in the way you describe.
    I refer you to this thread in this very forum
    Quote Originally Posted by ALL
    you should NEVER EVER use javascript as a password protection system, because all i would have to do is read the password right out of the js file or code.
    Need I say more?
    I've also found this which discusses the .htaccess method. It looks really straightforward, but as I said I don't use an Apache server, so I can't test it.

  7. #7
    critter183's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Re: Bar Access to a Site except a Link from another Site

    If you put your protected page in it's own directory folder, you can protect that directory from being accessed by bookmarks or typing into address bar using .htaccess.

    The following works on my site. I just tested it.

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
    RewriteRule \.(htm|html|php)$ http://mydomain.com/index.html [NC,R,L]
    The above will redirect anyone trying to access an htm, html, or php file in whatever directory this .htacces file is installed in, to your home page.

    Replace "yourdomain" with your domain name, and replace index.html, to whatever you use for your home page.



Tags for this Thread