Categories: Security

How to block or allow ips using .htaccess?

Suppose you have a site yourdomain.com and in the document root directory of yourdomain.com you have a directory “admin” in which you want to restrict the access to others. But you want to give access to clients from some ips.

You can do this by creating a .htaccess file under “admin” directory.

.htaccess file can be like this.

Order Deny,Allow
Deny from all
Allow from IP_address1
Allow from IP_address2
Allow from IP_address3
Allow from IP_address4
Allow from IP_address5

thats it.


HR-ADMIN

Recent Posts

How to Choose the Right Digital Marketing Agency: 15 Smart Questions

Digital marketing directly impacts revenue, brand positioning, and customer acquisition cost. Choosing the wrong agency can result in wasted budgets,…

6 days ago

WordPress 6.9 Update Guide: What’s New in the Latest Version

The release of WordPress 6.9 introduces meaningful enhancements focused on performance, block editing flexibility, design precision, and long-term scalability. This…

2 weeks ago

WP-Content Uploads Folder Explained (With Step-by-Step Upload Methods)

The wp-content/uploads folder is the core storage location for media files in WordPress. Every image, PDF, video, or document uploaded…

4 weeks ago

WordPress User Roles Explained: A Complete Guide to Permissions

Managing access correctly is one of the most important aspects of running a secure and scalable WordPress website. Managing access…

1 month ago

How to Get More Customer Reviews That Build Trust and Sales?

Customer reviews have become one of the most influential factors in modern buying decisions. Before choosing a product, service, or…

1 month ago