htaccess allow from 192.168.1.* isnt working - .htaccess

I made the following .htaccess Code, which typically should give access to the folder from internal network but external havent access.
The Problem: with 192.168.1.* I get blocked, with 192.168.1.49 (my local IP) I have access.
Does anybody have a clue why the IP range is blocked, but specific IP is allowed and how to get this fixxed?
Thanks and Cheers
AuthUserFile /home/.htpasswd
AuthType Basic
Require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.1.*
Satisfy any

Block access to all visitors except yourself using entire network ip
order allow,deny
allow from 192.168.
deny from all
It is also possible to block users by their host name.
order allow,deny
allow from stackoverflow.com
deny from all
If you want to access with particular ip then use the following command,
order allow,deny
allow from 192.168.0.10
deny from all

Related

htaccess, allow a single internal ip address

Good morning,
I have configured my .htaccess file as:
Order Allow,Deny
Allow from 65.43.173.125
Do you know if there is any way to allow a single internal IP address of that external IP address?
Something like
Order Allow,Deny
Allow from 65.43.173.125 But Only -> 192.168.0.53
I know both the external IP and internal IP that I want to allow.
Thanks in advance!
[IP address provided in the examples is random]
This should work:
Order Deny,Allow
Deny from all
Allow from 192.168.0.53
This will deny access to everyone from within the IP 65.43.173.125 except for 192.168.0.53

How to Block an IP range using .htaccess file

I want to block access of the following ips
https://gyazo.com/f41a53a1a385e41fe669064bff844a3a
i guess that comes in the range of
176.123..
so will this work ?
Order Allow,Deny
Deny from 176.123.0.0/16
Allow from all
also i have to keep this htaccess outside public_html folder ?
This should do the task
Order Allow,Deny
Deny from 176.123.0.0/16
Allow from all
and as Eric said the people within this ip rage can still access your site via a proxy server.
But if the allowed users have a particular ip range then this can sort it out
Order Allow,Deny
Deny from all
Allow from *ip range*

.htaccess Restrict/Allow by IP address to specific page

What I'm looking for is something along the lines below but instead of restricting access to the whole domain I want to restrict only a specific page and allow certain IP's to access it. Is this possible? Everywhere I searched is only for restricting the whole site. Thank you.
ErrorDocument 403 http://www.domainname.com
Order deny,allow
Deny from all
Allow from 124.34.48.165
Allow from 102.54.68.123
You can use a code like this
<Location /example-map>
Order deny,allow
deny from all
allow from 123.12.12.12
allow from 123.123.43.43
</Location>
This by the 123... the ip from the allowed ip's and /example-map the location
by RedDev

htaccess allow country domain

I would like to block all countries except mine which is Brunei. The domain is .bn
<Limit GET POST PUT>
order deny,allow
deny from all
allow from .bn
allow from *.bn
allow from *.*.bn
allow from *.*.*.bn
</Limit>
My Name Address: smp-85-139.simpur.net.bn so I believe the code below works:
allow from *.*.*.bn
But i still got forbidden access. Anything missing here?
I tried with IP but still blocked..
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 202.152.*.*
</Limit>
My IP is 202.152.85.139
UPDATE:
It appears my web host is using nginx so this setting won't work at all if I'm right.
Here is an .htaccess allow list for Brunei Darussalam, courtesy of Country IP Blocks. The data is correct and current as of 4/20/13.
If your hosting company allows you to use .htaccess you can copy and paste the below data into an .htaccess file and load it into your root:
<Limit GET POST>
order deny,allow
allow from 61.6.192.0/18
allow from 103.4.188.0/22
allow from 103.12.208.0/23
allow from 103.16.120.0/22
allow from 103.17.24.0/22
allow from 103.18.172.0/22
allow from 103.20.24.0/22
allow from 118.103.248.0/21
allow from 119.160.128.0/18
allow from 156.31.0.0/16
allow from 158.161.0.0/16
allow from 192.94.122.0/24
allow from 202.12.26.0/24
allow from 202.59.230.0/24
allow from 202.90.36.0/24
allow from 202.93.208.0/20
allow from 202.152.64.0/19
allow from 202.160.0.0/19
allow from 202.160.32.0/20
deny from all
</Limit>

Block Range of IPs

I'm trying to block a range of IPs from visiting my website
Here is what I have in my .htaccess file
order allow,deny
Deny from 64.244.0.0/64.245.255.255
Deny from 64.244.0.0/15
allow from all
I'd like to know if anyone can tell (or estimate) me how many IPs have i blocked there?
I believe the first DENY FROM is just wrong. I've always seen it this way
64.244.0.0/15
Base Address^ ^Number of bits to use for subnet
This would mean that you have 2^15 addresses in the deny block.
Edit
Using the comments below, what you would want is
ORDER deny,allow
DENY from 64.244.0.0/15
ALLOW from all

Resources