preload
十月 30

用.htaccess 讓Apache 決定此目錄的存取權限.
ex: 比如說 某目錄http://abc.xxx.xxx/user_a 需要作存取保護. 則可以在/var/www/html/user_a 中加入一個檔案.htaccess
範例如下:


   AuthUserFile /var/www/html/user_a/.htpasswd
   AuthName  "access"
   AuthType Basic
   <Limit GET>
      require valid-user
   </Limit>

並且用htpasswd 建立/var/www/html/user_a/.htpasswd 檔案.

還有就是在Apache 的http.conf 中的
加入
AllowOverride All

Comments are closed.