How to Restrict/Block IP Address using .htaccess File?

In this tutorial I’m going to learn how to block any IP Address using .htaccess file so follow this tutorial we ‘have demonstrated in very easy way.

Example 1: Block One IP Address:

simply create .htaccess file in your root directory and add following code on it.


order deny,allow
deny from all
allow from

Next open below IP address in browser

Now IP address is block thanks for reading this đź‘Ť

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

Traceback (most recent call last):File “/usr/bin/pipenv”, line 33, insys.exit(load_entry_point(‘pipenv==11.9.0’, ‘console_scripts’, ‘pipenv’)())

In this tutorial i’m going to solve the issue “Traceback (most recent call last):File “/usr/bin/pipenv”, line 33, insys.exit(load_entry_point(‘pipenv==11.9.0’, ‘console_scripts’, ‘pipenv’)())” Error :- Solutions :-

Top 25 Linux Commands for Users ?

In this tutorial i’m going to share Top 50 Important Linux Command for users with example. 1. Use of ls -la command. The ls -la command is…

SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES) (SQL: select * from information_schema.tables where table_schema

When I run this code in server it showing error Solution:- step 1 – go to this directory wz-tools-ms-renew/bootstrap/cache and delete config.php Next go to .env and…

How to Protect and Secure PHPMyAdmin in Production Server?

1. Disable Root Login Disabling root login is a good security practice as it reduces the risk of unauthorized access to your system. Here are general steps…

Failed to start mysql.service: Unit mysql.service not found.

Error :- mysqlshow: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) Solution Just go to below path Put below code in my.conf file then restart…

This page isn’t working | is currently unable to handle this request.

Error: – Solution : –

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x