Introduction
This article provides the procedure to restrict access to your site by the client's IP address.
Procedure
- Access the server's command line as the cPanel user via SSH or "Terminal" in cPanel.
- Open the site's
.htaccess
file in your preferred text editor. - Add the following to the
.htaccess
file.<RequireAll>
Please note that "203.0.113.2" must be replaced by the IP address to block.
Require all granted Require not ip 203.0.113.2
</RequireAll> - Save the changes and exit the text editor.
Please note that if the domain uses Cloudflare for its DNS, because Cloudflare proxies the connection, this would not work without disabling their proxy service.
Comments
0 comments
Article is closed for comments.