restricting access to page by IP not working
hello
i am trying to restrict access to a login.php page by IP address
I have the following in the .htaccess file in the same directory, but it blocking everything including this ip - where did i go wrong ?!
this post is from this older one :
Order deny,allow
Deny from all
Allow from 102.68.xx.xx
-
You can't put it in like that. You would put a range like that as 102.68.0.0/16 0 -
You can't put it in like that. You would put a range like that as 102.68.0.0/16
But i want to allow only one public IP address .. i added the ip with the range and it did not work ..ive even restarted the apache server in vain0 -
no answer ?! 0 -
Looks right to me assuming xx.xx are numbers and assuming login.php is the file you are trying to restrict access to. 0 -
Looks right to me assuming xx.xx are numbers and assuming login.php is the file you are trying to restrict access to.
yes the xx.xx are a completion of my public ip - but still it doesnt work i tried other ip as well .. same issue .. it keeps blocking me0 -
Technically Apache 2.4 uses Require now not allow/deny but it should still be usable. [QUOTE=http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#order]The Order directive, along with the Deny directives, controls a three-pass access control system. The first pass processes either all Deny directives, as specified by the Order directive. The second pass parses the rest of the directives (Allow). The third pass applies to all requests which do not match either of the first two. Note that all Deny directives are processed, unlike a typical firewall, where only the first match is used. The last match is effective (also unlike a typical firewall). Additionally, the order in which lines appear in the configuration files is not significant -- all Deny lines are considered as another, and the default state is considered by itself.
My assumption is that you don't have the correct IP in the allow from portion. If you wanted to learn more about Require directives you can find them here: mod_authz_host - Apache HTTP Server Version 2.40
Please sign in to leave a comment.
Comments
7 comments