Skip to content
Advertisement

How to set view protection in the beginning by .htaccess in the XAMPP for sub directories?

I have local website(php) on xampp and I want set user password login protection as shown as

enter image description here

I set in .htaccess :

JavaScript

And in .htpasswd I set:

JavaScript

But I after enter user password I get this error: enter image description here

I use this but not work. When I enter http:127.0.0.1/hi that work but when I enter sub directory not work (http:127.0.0.1/hi/test1) and give 500 error .

Advertisement

Answer

My code was OK but I do not know why an .htaccess empty file was created in all my sub folders when I delete them work correctly.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement