我有一個域名爲example.com
。 example.com
鏈接到Tumblr博客。 sub.example.com
指向我家的Ubuntu服務器的Apache服務器。我還在整個sub.example.com
(也就是說,用戶可以在任何網頁使用http
或https
之間選擇)中選擇性地啓用SSL。 sub.example.com/directory
是.htaccess保護。我可以在http://sub.example.com/directory
上很好地訪問目錄,但不能在https://sub.example.com/directory
上訪問目錄。在https
版本上,系統提示我輸入登錄信息。有一次,我進入了我的憑據,我得到這個錯誤:爲什麼.htaccess受保護的目錄在http上工作,但不在https上?
Error: File Not Found File Not Found.
我不知道發生了什麼錯誤。以下是完整的/var/www/html/directory/.htaccess
文件和/etc/apache2/apache2.conf
文件的選定部分。
的.htaccess:
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /var/www/.htpasswd
Require valid-user
apache2.conf:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
我在Ubuntu 14.10和Apache 2.4.10
HTTPS在受保護的目錄之外正常工作。 使用HTTP時可以通過密碼訪問該目錄。 由於HTTPS在'sub.example.com'上正常工作,因此SSL(假定)配置正確。 – 2015-02-12 16:40:44