Restrict certain hosts or IP address

Version: 12.4
Revision: 45 Build 68

Restrict certain hosts or IP address

Introduction: this tutorial will help user to block bad hosts and IP address from tampering your website. On the other hand, you will need to be careful with your .htaccess file – configurations; if you set one of the commands by mistake, your browser will generate a blank page with an Error 404 or 500.

1.] Download notepad++ from the original author or from a mirror and install the software.

——————————-

http://sourceforge.net/projects/notepad-plus/

http://filehippo.com/download_notepad/

——————————-

2.] Copy this code to your notepad and save the source code as “.htaccess”.

This source code is use to block everyone and it will only allow certain host / IP address to access.

Warning: you must be careful and test your htaccess file in a sub folder.
A slight mistake will also block you and your entire website!

Notes: Limit Get Post is defined as…
- limit the IP ban (users) to GET requests and POST actions.

—Copy Source Code—

<Limit GET POST>
order deny,allow
deny from all
allow from 199.166.210.55
allow from 199.166.120.22
allow from allowdomain1.net
allow from allowdomain2.net
allow from allowdomain3.net
</Limit>

—End Source Code—

This source code is a little different. But, it will allow everyone and it will only block certain host / IP address to access.

—Copy Source Code—

<Limit GET POST>
order allow,deny
allow from all
deny from 199.166.210.55
deny from 199.166.120.22
deny from denydomain1.net
deny from denydomain2.net
deny from denydomain3.net
</Limit>

—End Source Code—

This source code is the same and it also performs the same job…

Notes: Limit Get is defined as…
- limit the IP ban (users) to GET requests.

—Copy Source Code—

<Limit GET>
order deny,allow
deny from 63.135.80.49
deny from 208.75.184.192
deny from denydomain1.net
deny from denydomain2.net
deny from denydomain3.net
allow from all
</LIMIT>

—End Source Code—

This source code is the same as the above. But, it blocks everyone and allows certain host / IP address to access.

—Copy Source Code—

<Limit GET>
order allow,deny
allow from 63.135.80.49
allow from 208.75.184.192
allow from allowdomain1.net
allow from allowdomain2.net
allow from allowdomain3.net
deny from all
</LIMIT>

—End Source Code—

This source will also do the trick. However, it’s a little more strict…

—Copy Source Code—

<Limit GET HEAD POST>
order deny,allow
deny from 128.42
deny from 192.136.146
deny from 192.136.153
deny from 192.225.19
deny from denydomain1.net
allow from all
</LIMIT>

—End Source Code—

To block users from looking at your htaccess files, you can use this source code…

—Copy Source Code—

<Files .htaccess>
order allow,deny
deny from all
</Files>

—End Source Code—
Copyrighted by Lair360

Comments are closed.