I Method (easier)
Securing login to our Joomla or WordPress can be done using the built-in tool in cPanel. Our task is to secure the wp-admin directory for WordPress. For Joomla, protect the "administrator" directory in the same way as in the example below.
Log in to cPanel and search for the option "Directory privacy"
Then, by clicking on the folder icons, we go to the WordPress or Joomla directory
Next, click the edit button next to the desired directory and complete the form. The first step is to select the checkbox "Password protect this directory", then enter any name for the protected directory and press save. Later, we only create the user and enter the password, which we will use additionally to log in and click save.
Now, after going to customer-domain.eu/wp-admin/ or to customer-domain.eu/administrator, the following window will appear:
II Method (recommended, more difficult)
The simplest security method, and probably the most popular, is to use auth_basic authorization. We will need two files for this: .htaccess and .htpasswd.
In the case of joomla, you will need to insert into the .htacces file:
AuthName "Joomla - Restricted area"
AuthType Basic
AuthUserFile /home/customerdomain/public_html/joomla/administrator/.htpasswd
Require valid-user
And to prevent an error 500 in front of the line:
RewriteRule. * Index.php [L]
Add this:
RewriteCond% {REQUEST_URI} ^ / administrator /
Then generate the contents of the .htpasswd file, which we will put in the administrator directory. You can do it, for example, here: http://www.htaccesstools.com/htpasswd-generator/
It is similar for WordPress, where in the main directory we paste into the .htaccess file:
AuthName "WordPress site - Restricted area"
AuthType Basic
AuthUserFile /home/customerdomain/public_html/wordpress/.htpasswd
Require valid-user
Then generate the .htpasswd file as described above and place it in the root directory of wordpress.
Speed and performance: full SSD, http/2, multiple cache methods, free data migration, free SSL certificates
Security and performance: full separation, anti-exploit technology, full SSD, http/2, free SSL certificates
Several hundred types of domains from all around the world can be registered at Smarthost.au. Our prices are affordable for everyone.