Thursday, 7 January 2016

How to setup .htaccess and .htpasswd in Godaddy Web Hosting

It came to my frustration that Godaddy did not have a proper documentation on how to set up .htaccess and .htpasswd for basic web hosting user. 

Below is a simple tutorial on how to setup :- 

1.Find out what’s your Absolute hosting path, your absolute hosting path specifically points to your hosting account on our server's file system. 

 - Log in to your Account Manager. 
 - Click Web Hosting. 
 - Next to the hosting account you want to use, click Manage. 
 - In the Server Details section, click Show details. 
 - Your absolute hosting path displays in the Absolute Hosting Path section 

2. Set up the .htaccess file with the sample content below:- 

AuthType Basic 
AuthName "Protected Area" 
AuthUserFile [Absolute Path]/[Path to your folder]/.htpasswd 
Require user [Username] 

*If the folder you wish to protect is /usr/local/somefolder, the .htaccess and .htpasswd shall be stored in /usr/local/.htaccess and /user/local/.htpasswd 
*Replace Username with the username that you wish to grant the access 

3. Set up the .htpasswd, you can generate the username and password with the following tool 

* It should look something like  user:$apr1$xkRl/va4$x984dmr3HeWUYVK6FURpE. 
* The username shall appear in the .htaccess file [Username] section

1 comment:

  1. Thanks for an insightful post.These tips are really helpful. Thanks a lot.Keep it up.Keep blogging.!!
    Best Android App Development Company In malaysia!


Popular posts

Recent Posts

Unordered List

Text Widget

Latest Post

Popular posts