Create Password Protect Admin.php - Xenforo 2

Create Password Protect Admin.php - Xenforo 2

Create-Password-Protect-Admin-Xenforo-2.webp

You can increase the security of Admin Xenforo by creating an extra password to access the admin.php file, using .htaccess and .htpasswd

Step One: Edit .htaccess

Add the following lines to the .htaccess file, at the root directory (containing the admin.php file).

Code:
You must be logged-in to view.
(6 lines)

Change /path/to/public/.htpasswd according to the configuration on your server.

Step Two: Create .htpasswd
Create a new .htpasswd file in the root directory.
Visit the website: hostingcanada.org/htpasswd-generator/
Enter the username and password used to access the admin.php file. Then click Create .htpasswd file
Then you will get a piece of code that looks like: username:{SHA}abcxyzxxxx
Copy that code and paste it into the .htpasswd file.

Create-Password-Protect-Admin-Xenforo-2-2.webp


That's It! When you visit the file through your browser, you'll now be prompted for a username and password.

file-password.webp
 
Last edited by a moderator:
Top