Deprecated: Class Jetpack_Geo_Location is deprecated since version 14.3 with no alternative available. in /home/everyuseful/public_html/wp-includes/functions.php on line 6114
Password protect a folder in xampp - EveryUseful

Password protect a folder in xampp

Here is how to protect a folder with username and password in xampp :

  1. Open the command promote
  2. Go to your xampp folder and then go to: /apache/bin/
  3. Run this command :

    htpasswd.exe -c -b .htpasswd my_user _name my_password

    Don’t forget Change “my_user_name” and “my_password”
  4. A file with the name of .htpasswd will be created at the folder of /apache/bin
  5. Create a file with the name of : .htaccess at the folder you want to protect ( don’t forget the dot in .htaccess)
  6. Write the following in the .htaccess file:

    AuthType Basic
    AuthName “v3d”
    AuthUserFile “c:/xampp/apache/bin/.htpasswd”
    require valid-user


    Note that the path in AuthUserFile line (c:/xampp/apache/bin/.htpasswd) is the path to your xampp folder where the .htpasswd file is created, very important to keep this file away from the httdocs folder.