0

i use following code in .htaccess file to usr/psw protect a web folder. However i want to protect this folder only if its accessed outside of 192.168.178.* How can i do this?

AuthUserFile /var/www/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Access"
AuthType Basic

<Limit GET POST >
require valid-user
</Limit>

Thanks

Kupe3
  • 115
  • 1
  • 1
  • 3

1 Answers1

0

You can do this by replacing 'require valid-user' with the following lines:

require valid-user
Allow from 192.168.178.0/24
Satisfy Any

Edit: You have to add:

Order deny,allow
Deny from all
Simon Strasser
  • 227
  • 1
  • 8