Main Page/Stuff/password-protect/htaccess

From phurvitz
Jump to: navigation, search

<source lang="bash">

  1. !/bin/sh

if [ -f ./.htaccess ] then

  rm ./.htaccess

fi touch ./.htaccess dir=`pwd` echo $dir echo "AuthUserFile $dir/.htpasswd" >> ./.htaccess echo "AuthName Here" >> ./.htaccess echo "AuthType Basic" >> ./.htaccess echo "<Limit GET>" >> ./.htaccess echo "require valid-user" >> ./.htaccess echo "</Limit>" >> ./.htaccess </source>