By editor, 28 June, 2016 Question How to control access using Apache's .HTACCESS file ? 1. Access control by IP : (Example) order deny,allow deny from all allow from [YOUR_IP_ADDRESS] 2. By password : AuthType Basic AuthName "Password Protected Area" AuthUserFile /path/to/.htpasswd Require valid-user The Password file (.htpasswd) must have users list with encrypted passwords like: test:dGRkPurkuWmW2 3. Add new user using htpasswd Example : Create password file and add a new user htpasswd -c /path/to/.htpasswd username Example : Add to File htpasswd /path/to/.htpasswd username Example: Print to terminal htpasswd -n username And Also Set Error Documents ErrorDocument 403 path/to403.html ErrorDocument 404 path/to404.html Tags Server Linux Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments