MyBB Community Forums

Full Version: htaccess - allow within my ip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I would like a website to be accessed only with specific username and password and from a computer of a specific IP:

My .htaccess looks like that:
Order deny, allow
Allow from MY-IP

AuthType Basic
AuthName "My Protected Area"
AuthUserFile /PATH TO htpasswd/.htpasswd
Require valid-user


However, I discovered that in fact ANY IP can connect if has correct username and password.. 
What is the mistake in the code, can anybody help me?

Ramireo
I guess you are missing deny command.

order deny,allow
deny from all
allow from YOUR_IP
Thanks!
Also, it looks like my IP is dynamic and Id have to change the htaccess file like every 10 minutes..
Is there some way to give my dynamic IP some sort of static IP, or how can I solve this problem in any other way?
If you know the range you can declare the range this way:

allow from 193.122.7.0/254

This will allow a range of IP from 193.122.7.0 to 193.122.7.254 (example IP)

If you don't know the range then password is your only option, may be you can try to extend this upto implementing some 2FA.