Add Authorization to your Website using .htaccess file

You have to create 2 files first is .htaccess file and another is .htpasswd file
code of .htaccess file :


#deny from all
allow from all
AuthUserFile path-of-your-.htpasswd-file e.g. /usr/home/aftab/public_html/store/.htpasswd
AuthType Basic
AuthName "Authorization Required"
Require valid-user

and code of .htpasswd file :


admin:$apr1$q6ubsdpg$4wxS3b2npMlpfT3JbqRkW.
//admin is the username
// and password is encrypted by MD5

.htaccess-view

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s