+ Reply to Thread
Results 1 to 3 of 3

Thread: Friends Only Site Access

  1. #1
    rockee is offline x10 Sophmore rockee is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    120

    Lightbulb Friends Only Site Access

    Here is a nice little .htaccess helper that will allow only your known friends to access a particular folder on your web site without the need to provide an authentication method like a username and password combination, which can be a hassle to set up just for a couple of your best friends to access some special files you want them to see or to download.

    All your friend needs to do is provide you with their IP address, which you more than likely know already.

    This is not suitable for your friends who may have a dynamic IP provided by their ISP - a dynamic IP is one that changes every time you connect to the Internet via your Internet Service Provider (ISP).


    1. Make a new folder under your web root public_html folder and name it what you like and place the files you want only your friends to access in this new folder.
    (You could even create a sub-domain via cPanel for this purpose if you prefer, but remember they are limited in quantity on free hosting).
    Make sure you also add an index.html or an index.php file to this folder or if you prefer just a file listing then omit adding an index file.

    2. Create a .htaccess file in your cPanel File Manager(Legacy) or via your ftp client and add these lines:

    order allow,deny
    allow from 111.222.333.444
    <- substitute here your friend's IP
    deny from all

    Or if you wish to add multiple known friends and their IPs, so only they have access to this special folder, do this:

    order allow,deny
    allow from 111.222.333.001
    <- substitute here your friend 1's IP
    allow from 111.222.333.002 <- substitute here your friend 2's IP
    allow from 111.222.333.003 <- substitute here your friend 3's IP
    deny from all

    3. Save the file.
    Now all you need to do is tell your friends the URI of this special folder.
    For example:
    http://you.x10hosting.com/friendsfolder/
    or
    http://yoursite.tld/friendsfolder



    If you fall out with a friend you have given this special access to, then all you need do is delete that ex-friends IP from the .htaccess file and voilā, access is denied - conversely if you find a new friend and want to add their IP, then edit the .htaccess file again and simply add their IP to the list.
    Job done!


    Happy file and picture sharing.

    Regards,
    Rocky

  2. #2
    tittat's Avatar
    tittat is offline x10 Spammer tittat is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Kerala,India
    Posts
    2,479

    Re: Friends Only Site Access

    but the problem is most of us have dynamic ip.
    Does this stuff work with widcard characters,so that we can try to implement it for dynamic ip's.
    PLAY ONLINE GAMES
    WWW.TMONDO.COM PlayFar Flash Games
    Former X10 Forum Senior Moderator(Retired)


  3. #3
    rockee is offline x10 Sophmore rockee is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    120

    Re: Friends Only Site Access

    Yes wild card IP ranges not characters are possible, here's how to cover a range of IP addresses from a particular ISP.
    order allow,deny
    allow from 111.222.333 <- substitute here your friend's Dynamic IP range
    deny from all


    or even more allowed IPs in this ISP's dynamic range.
    order allow,deny
    allow from 111.222 <- substitute here your friend's Dynamic IP range
    deny from all


    Regards,
    Rocky

+ Reply to Thread

Similar Threads

  1. Wont Let me access cpanel and my site
    By duncan4000 in forum Free Hosting
    Replies: 2
    Last Post: 11-22-2007, 12:33 AM
  2. Can't access site and cpane AGAIN
    By TomyVk in forum Free Hosting
    Replies: 0
    Last Post: 11-21-2007, 09:22 AM
  3. Can't Access The Site
    By sakuraguy in forum Free Hosting
    Replies: 6
    Last Post: 09-02-2007, 01:13 PM
  4. cant access my site
    By oab in forum Free Hosting
    Replies: 3
    Last Post: 09-16-2005, 11:12 PM
  5. Cannot access Cpannel or the FTP & Site himself.
    By FeestBijtje in forum Free Hosting
    Replies: 2
    Last Post: 09-11-2005, 12:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers