There is a situation where you want to be protect your site using htaccess that no body can access your site except you .
Step you need to be follow :
Step you need to be follow :
Create the Password File
- Open a new text file called
Note the period at the beginning of the filename..htpasswd
- Use a password encryption program to create your passwords. Paste the lines into your .htpasswd file and save the file. You will have one line for every username that requires access.
- Upload the .htpasswd file to a directory on your Web server that is not live on the Web. In other words, you should not be able to go to http://YOUR_URL/.htpasswd - it should be in a home directory or other location that is secure.
Create the htaccess File
- Open a text file called
.htaccess
Note the period at the beginning of the filename. - Add the following to the file:
AuthUserFile /path/to/htpasswd/file/.htpasswd AuthGroupFile /dev/null AuthName "Name of Area" AuthType Basic require valid-user
- Change
to the full path to the .htpasswd file you uploaded in above./path/to/htpasswd/file/.htpasswd
- Change
"Name of Area"
to the name of the site you want to be protected. This is used primarily when you have multiple areas with different protection levels. - Save the file and upload it to the directory you want protected.
- Test that the password works by accessing the URL. If your password doesn't work, go back to the encryption programs and encrypt it again. Remember that the username and password will be case-sensitive. If you are not prompted for a password, contact your system administrator to make sure that HTAccess is turned on for your site.
Tags:
htaccess
Good work dear :)
ReplyDeleteThanks ... :)
DeletePurchasetheme is one kind of platform for the developers and designers. Whoever feels important can buy and sell the readymade work related to web development assets and print comprising scripts, codes, themes, banners, logos, graphics, plugins as well as mobile or desktop app source codes. Ajax Search Opencart
ReplyDelete