Results 1 to 6 of 6

Thread: Restricting Access to Website

  1. #1
    Registered
    Join Date
    Jun 2015
    Location
    USA
    Posts
    4
    Rep Power
    0

    Restricting Access to Website

    I have two web sites. Let's say they are www.siteone.com and www.sitetwo.com.
    Inside www.siteone.com is a link to the home page of www.sitetwo.com.
    How can I restrict access to sitetwo.com to only those coming from the link in siteone.com.
    I tried the following .htaccess in the root of sitetwo.com:
    order allow, deny
    allow from www.siteone.com
    deny from all

    Unfortunately, that doesn't work, and I know just enough about .htaccess to be dangerous. Any help will be appreciated.
    Ronaldo38

  2. #2
    Rick
    Join Date
    May 2002
    Location
    Minneapolis, MN
    Posts
    1,753
    Rep Power
    19
    Without getting too technical, it would be complicated to only allow users coming from one site to visit another. If you need to restrict access to a website, the simplest way is to use an .htaccess instruction to require a user name and password. I found an Apache tutorial that explains the process.

    If you could explain why you want this restriction and why the process requires two websites, maybe someone could suggest a better alternative.
    Rick Trethewey

  3. #3
    Registered
    Join Date
    Jun 2015
    Location
    USA
    Posts
    4
    Rep Power
    0
    Quote Originally Posted by ronaldo38 View Post
    I have two web sites. Let's say they are www.siteone.com and www.sitetwo.com.
    Inside www.siteone.com is a link to the home page of www.sitetwo.com.
    How can I restrict access to sitetwo.com to only those coming from the link in siteone.com.
    I tried the following .htaccess in the root of sitetwo.com:
    order allow, deny
    allow from www.siteone.com
    deny from all

    Unfortunately, that doesn't work, and I know just enough about .htaccess to be dangerous. Any help will be appreciated.
    Ronaldo38
    Rainbore, thank you for your response. I'm already using .htaccess to require username and password to restrict access to Siteone. I want only those from Siteone to access the videos I have on Sitetwo, and I really don't want them to have to enter their username and password again when they visit Sitetwo.
    Who do this, you ask??? We are a small homeowners association, and most of our content is on Siteone. However, we have two- and three-hour videos of our monthly board meetings on Sitetwo. I don't want to air our dirty laundry with the rest of the world, so I want to restrict access to the videos to our homeowners who are already signed onto Siteone.
    I know, TMI. Sorry.

  4. #4
    Registered
    Join Date
    Jun 2015
    Location
    USA
    Posts
    4
    Rep Power
    0
    Actually, I did reply several days ago, but somehow it didn't make it to the forum...
    Anyway, we are a small homeowners association, and our web site is Siteone.com. We televise our monthly board meetings, and we put WMV files of those board meetings on Sitetwo. Our web hosting company barks at us when we have too many video files on Siteone.com, so we created a second site, Sitetwo to host the videos.
    We don't want to air our dirty laundry to the rest of the world, so we want to restrict access to Sitetwo to only those who click on the link in Siteone.
    Thanks in advance for any help you can offer.

  5. #5
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,333
    Rep Power
    27
    You have the order wrong, with allow first it's to late to deny, as they are already in.

    Order deny,allow
    Deny from all
    Allow from siteone.com

    Note, it is better to use the siteone.com IP address as host names in Allow or Deny statements will force the HTTPd to do reverse DNS lookups on every request slowing down delivery. And as Rainbore suggests, this is not a great way of securing content from prying eyes. A new host under a single site.com using php would be the ideal.
    Croc Hunter MSC :

  6. #6
    Registered
    Join Date
    Jun 2015
    Location
    USA
    Posts
    4
    Rep Power
    0
    Thanks to both of you for replying. I'll give your suggestion a try.
    And thanks again.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •