How do I restrict access to sensitive Joomla directories by IP address?

Restricting the access to the critical Joomla directories such as administrator/ by IP address is a good security measure. This way you can allow access to your Joomla backend only from your own IP address.

In order to implement such a restriction you have to add the following lines in your .htaccess file residing in the directory you wish to protect:

where the sample IP address has to be replaced with your own IP.

This file can be modified via FTP, or from File Manager in cPanel and you can find what your IP is using this online tool.

More on the Joomla! security can be found in our Joomla! Security Tutorial.

Joomla is a powerful software that is easy to work with once you have the right host to support you. Before you lose any more time with the wrong host, check out the SiteGround Joomla hosting offer.