Commonly asked Data Structures and Algorithms Problems by big tech and different solution approaches with code in Java and C

Powered by Blogger.

Friday, April 6, 2018

Password Protected Directory XAMPP


Xampp has file htpasswd.exe which handle all this 
It resides in apache/bin


Step 1:

You need to run a command using cmd panel to create Password Protected Directory 
first go inside your xampp directory then into apache/bin

Replace admin (1st to username) and 2nd to password
 C:\xampp\htdocs\project\admin_p\ - directory to be protected.



htpasswd.exe  -c -b C:\xampp\htdocs\project\admin_p\.htpasswd admin admin


Step 2:

create a file named .htaccess inside this directory
and copy this into it (C:\xampp\htdocs\project\admin_p\.htpasswd replace to your directory)



# Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteBase /



AuthName "Message : hackerranksolutionc.blogspot.com"
AuthType Basic
AuthUserFile C:\xampp\htdocs\project\admin_p\.htpasswd
require valid-user



You are done !!!

0 Comments:

Post a Comment

Stats