Create Password Protect Admin.php - Xenforo 2

Create Password Protect Admin.php - Xenforo 2

  • Thread starter Thread starter xenvn
  • Start date Start date
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 log 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:
@xenvn I use shared Web Hosting or cPanel as I find the folder (admin) of xenForo or what is the htaccess file that I must modify ?
 
ok function!
 
Last edited:
Does this work on 2.3.6?
I have tried everything and I cannot seem to get it to work.
I cannot get past the login. I followed the instructions perfectly.


*EDIT*
I did manage to figure this out and I can say that it does indeed work on 2.3.6 if anybody is wondering the same.
My mistake was not copying the entire address to the file.

I also added ip address access to the existing.

Code:
You must log in to view
(7 lines)
 
Last edited:
Back
Top Bottom