How to create password protected web page and files with htaccess
In this post we will give you information about How to create password protected web page and files with htaccess. Hear we will give you detail about How to create password protected web page and files with htaccessAnd how to use it also give you demo for it if it is necessary.
In this tutorial, I will let you know how to use .htaccess to password protect your web pages in simple steps.
There are so many website that protect their some pages by asking you for a username and password. Without entering valid credentials, you can not see the web pages.
How to revoke 'git add' before 'git commit' ?
In this post we will give you information about How to revoke 'git add' before 'git commit' ?. Hear we will give you detail about How to revoke 'git add' before 'git commit' ?And how to use it also give you demo for it if it is necessary.
Sometimes you need to undo your git file before you git comment command. Because you made a some misteck or wrong code and you did git add using "git add ." command then you think how to undo your code before git commit command. But you can do that using git reset command, if you need to undo all file Or you may need to undo just one then you can do using git reset command, you can see bellow command.
Example:
// For Spesific filegit reset
// For all files
git reset
Hope this code and post will helped you for implement How to revoke 'git add' before 'git commit' ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs
Htaccess is known as most secure method of password protection. Using .htaccess you can protect single webpage or entire directory.
You will need to create two files .htaccess and .htpasswd in the directory that you are going to password protect.
For this example, I create a blog directory in /var/www/html/.
Now run the following command to generate .htpasswd file with username and password.
htpasswd -c .htpasswd your-user-name
.htpasswd file should contain :
user:$apr1$c4Ol904J$SmqVIhw53PGDmaVWM9Vhx.
Now add following line of code in the .htaccess file :
AuthType Basic AuthName "Password Protected Area" AuthUserFile /var/www/html/blog/.htpasswd Require valid-user
Now when you run your blog application in the browser it will ask you for username and password.
If your web server does not support htaccess then above steps will not work.
Your htaccess file must be a text file not some other format.
Try this..
Label :
.htaccess
Apache
Web Development
Hope this code and post will helped you for implement How to create password protected web page and files with htaccess. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs