Blocking IP Address


I’m trying to block an IP address that seems to be connecting to my site, registering and then posting gibberish dozens of times per day.
I create a file called “.htaccess” that contains the following lines (and nothing else):

order allow,deny
deny from
allow from all

However, every time I try to copy the file into my directories on the host, it vanishes. I am at a loss.

Any ideas? Thanks in advance.


Your FTP client may be set to not show hidden files. I am sure it’s there but if you want to see it you will need to change that particular setting.


Cool. Thanks for the info!


I have a related question. I prepared a .htaccess file (without the .txt extension) on notepad with the following lines and uploaded it to the main folder in my domain

order allow,deny
deny from
allow from all

But the IP address above is still able to access my domain. I tried entering my own IP address to the list as well, but that didn’t block me either. Any suggestions? Thanks.


“Order allow,deny” means that Apache looks at the “Allow all” first, allowing it to override the “Deny from”. Use “Order deny,allow” to block specific addresses.


Makes sense. I’ll give it a try. Thanks.


I changed the .htaccess file to read

order deny,allow
deny from
allow from all

but the IP in question is still accessing my domain. Any ideas?