PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 3, 2022

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

 July 03, 2022     .htaccess, authentication, php, xampp     No comments   

Issue

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 :

Options -Indexes
allow from 127.0.0.0
AuthName "Password Protected Area" 
AuthUserFile /htaccess/.htpasswd 
AuthType Basic
Require valid-user

And in .htpasswd I set:

user:$2y$10$L7cqU20P.fbfHwIL7cqU20PsvrhnN.Pb1rAxR50y

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 .


Solution

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.



Answered By - Tomy
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing