only allow certain ip's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snow
    Junior Member
    • May 2006
    • 1

    only allow certain ip's

    is there a way to only allow certain ip's to access a domain? I need a super secure site, which will only allow 1 certain ip to a login screen.

    thanks
  • djn
    Senior Member
    • Mar 2004
    • 140

    #2
    First you have to password protect the public_html folder in cpanel and create an authorized user, then you can edit the newly created .htaccess file into something like this:

    order deny, allow
    deny from all
    allow from xxx.xxx.xxx.xxx (this is the allowed IP)
    AuthType Basic
    AuthName "...whatever"
    AuthUserFile "/home/your_user/.htpasswds/your_protected_folder/passwd"
    require valid-user
    satisfy all

    Comment

    Working...