Results 1 to 2 of 2

Thread: htaccess - allow some unrestricted, login user+pass for everyone else

  1. #1
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default htaccess - allow some unrestricted, login user+pass for everyone else

    I am trying to setup a protected folder on my website with the following two rules:

    1) Users coming from one of our two static IPs can access the folder without needing to enter a username or password.

    2) All other attempts to access the folder are met with a username and password login.


    I have been able to meet point 1 with the following .htaccess file code...

    Code:
    #deny all access
    deny from all
    allow from 111.222.333.444 111.222.333.555
    
    <IfModule mod_speling.c>
    CheckSpelling On
    </IfModule>

    I have been able to meet point 2 by using the Dynamic Drive htaccess generator at the following location: http://tools.dynamicdrive.com/password/


    Unfortunately my attempts to combine the code has failed.

    Is this even possible. If so, can someone show me how?


    Cheers,

    Stanbridge

  2. #2
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, nevermind folks, got it sorted...

    I found another page that has a list of sample HTACCESS files:
    http://www.evolt.org/ultimate_htaccess_examples

    Someone on another forum also showed me this page:
    http://httpd.apache.org/docs/1.3/mod/core.html#satisfy

    My finished, working HTACCESS file looks like this:

    Order allow,deny
    AuthUserFile /usr/home/myfolder/.htpasswd
    AuthType Basic
    AuthName "MyFolder TopSecret Area"
    Require valid-user
    Allow from 111.222.333.444 111.222.333.555
    Satisfy Any

    Cheers,

    Stanbridge

Tags for this Thread

Bookmarks

Posting Permissions

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