ad

Friday, 13 November 2015

Block unwanted users from your website with apache

It doesn't take very long before some users start becoming a problem for the website itself.. to get rid of these type of users you can ban them by IP - ofcourse they can hide behind proxy, but here's an ways to block users from your website, for this you need access to .htaccess file. Most host give you the access, if you don't see no file, create one! .htaccess is a configuration file for apache! don't confuse it with php.ini file which's for PHP.

Type this in .htaccess file and restart your server(if it's localhost) if it's up in cloud just refresh the page for test!

deny from all IP.AD.D.RE.SS
 
And you're done! MAGIC!? To ban multiple IP's you can repeat the statement.

Wanna see it in action? Here:
[​IMG]

What about trying it on localhost? Save .htaccess file with this:
Deny all from 127.0.0.1

No comments:

Post a Comment