softstor
12-06-2004, 09:50 AM
I have a .htaccess file setup on my server to deny access of specific ip addresses. One of the lines in this file contains the following:
deny from 221.132
However, a user with ip address of 221.132.5.19 was able to gain access.
What is the correct procedure to block all ip addresses that start with 221.132?
YUPAPA
12-06-2004, 10:01 AM
Order Allow,Deny
Allow from all
Deny from 221.132
softstor
12-06-2004, 10:06 AM
Acually the file very long with many ip addresses listed. I only shows one line. This is more what the file actually has:
<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 221.132
Should I remove the <files> </files> line?
YUPAPA
12-06-2004, 10:11 AM
Originally posted by softstor
Acually the file very long with many ip addresses listed. I only shows one line. This is more what the file actually has:
<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 221.132
Should I remove the <files> </files> line?
I don't understand what you are trying to do with that 403.shtml ~~ Are you trying to secure it so that 221.132 will not be able to access 403.shtml? If that is the case, move the Deny from 221.132 within the <files></files> :fairy:
If 403.shtml is a file contains a long list of IP and you want .htaccess to ban all of those, you will have to add them to .htaccess ~
softstor
12-06-2004, 10:46 AM
I found a sample .htaccess file someplace a while back that used the <files> clause. I do not have a 403.shtml. In fact, I do not even know what this type of file even does.
Should I use the following instead:?
order allow,deny
allow from all
deny from 221.132
YUPAPA
12-06-2004, 10:56 AM
Oh yar my first example should work~ :angel:
It would give a 403 error when a user has an IP on the banned list ~
Try to add your own and it would tell you to eat a 403 ~ :stickout:
softstor
12-06-2004, 11:05 AM
Thanks. One more question...
If the .htaccess file is located in a sub folder (not the root folder), will all sub folders under this sub folder follow the same rules defined in the .htaccess file?
YUPAPA
12-06-2004, 11:10 AM
Correct, but there is a way to prevent that if you need it ~ :fairy: