How to protect a single php page with htaccess?

I want to restrict a PHP page in a website. This page is in a CMS.

The page is like this.

For this I have updated my .htaccess file like this.

AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /home/bioenerg/password/.htpasswd 
AuthGroupFile /dev/null 
   require valid-user

Then I created .htpasswd file in a folder called “password”. Because this is not secure if we created this in the root folder.

Then I added the generated password to this file.
My .htpasswd file is like this.


Source: .htaccess

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.