you are here: codestackercodes [RSS] → tag htaccess [RSS]

force download .htaccess

AddType application/octet-stream .doc .mov .avi .pdf .xls .mp4

Password protecting your pages with htaccess

create a .htaccess file with this content.

the .htpasswd contains a user and encrypted password (e.g.: leo:4tHAiRmQ4OpjM). create a encrypted password in: http://www.kxs.net/support/htaccess_pw.html

AuthUserFile /home/leonardo/public_html/project/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Access"
AuthType Basic
<limit GET>
require valid-user
</limit>

activing php_auth on dreamhost

by default, dreamhost runs php as cgi.
the follow line switchs from cgi to apache module execution, supporting php_auth.

// create a .htaccess with this: 
AddHandler application/x-httpd-php .php
Displaying all 3 Code