.htaccess on xampp for Windows

You need .htaccess on xampp for Windows.

Open a command line. Write there

C:\xampp\apache\bin>htpasswd -c -m -b c:\xampp\htdocs\.htpasswd username password

Create a .htaccess file and fill in it

AuthType Basic
AuthName "Access for restricted area"
AuthUserFile c:/xampp/htdocs/.htpasswd
require user username

Copy the .htaccess file to the directory you need the secured area.

Difference to your settings are: The path to the apache bin folder or htdocs folder on your xampp installation could be different. Change the above mentioned paths to your need.

The words “username” and “password” are only synonyms for real terms.

This entry was posted in System and tagged , on by .

About Erdal Gök

Erdal Gök is a web consultant. He works since 1996 as a webworker and is self-employed since 2004. His main skills starts from building concepts for web-projects over designing and implemanting web-frameworks like TYPO3 or creating frontend templates on HTML / CSS or getting interactivity with Javascript.

4 thoughts on “.htaccess on xampp for Windows

  1. Arup debnath

    dear buddy

    writting with problem which is q:- how to protect webdiretory and file when i upload file all in xampp localhost ( i want only to view only my webfile with pages but not view by other person who sit for hacking file )

  2. Arup debnath

    dear buddy

    writting with problem which is q:- how to protect webdiretory and file when i upload file all in xampp localhost ( i want only to view only my webfile with pages but not view by other person who sit for hacking file ) plz solve this

  3. Arup debnath

    dear buddy

    writting with problem which is q:- how to protect webdiretory and file when i upload file all in xampp localhost ( i want only to view only my webfile with pages but not view by other person who sit for hacking file ) solve it

    and mail me at given mail id to you

  4. Erdal

    Hi Arup, isn’t the htaccess approach working for you? And XAMPP is not designed for production environment, you should switch to something else.

Leave a Reply

Your email address will not be published. Required fields are marked *