1

Can someone take a look at the syntax of the code below and let me know if it is correct

-- my intention is to exclude the htaccess for the IP ranges specified in the 'Allow' part and rest of all should ask for authentication when they access the site.

This is simply 'denies' every one . IP range specified in Allow from should not ask for htaccess , But it asking for htaccess fro every one.

Can anyone confirm this, and help me to make this work:

    Options FollowSymLinks
    AllowOverride None
    AuthUserFile /etc/.htpasswd
    AuthGroupFile /dev/null
    AuthName EnterPassword
    AuthType Basic
    require valid-user
    Order deny,allow
    Deny from all
    Allow from 30.21.37.
    Allow from 113.11.23.23

Chandana
  • 11
  • 1
  • 2

2 Answers2

1

You could try the following

Order Deny, Allow
Deny from All

AuthName "EnterPassword"
AuthUserFile /etc/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
Require valid-user

Allow from xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz
Satisfy Any
ALex_hha
  • 7,193
  • 1
  • 25
  • 40
0

There are several ways to Allow from specifc IP address in htaccess. Here is the best and easy solution

http://www.toshop.com/htaccess-generator.cfm

Just Select your desired option and click on generate.