不知道這是否有幫助,也有一段時間的瀏覽器劑量DNS緩存嘗試清除它,在Chrome中,你可以轉到Chrome:// net-internals /#dns並清除它,或使用其他瀏覽器進行測試。
<VirtualHost *:80>
DocumentRoot /home/webroot/example.com/htdocs
ServerName example.com
ServerAlias www.example.com
<Directory /home/webroot/example.com/htdocs>
FileETag MTime Size
DirectoryIndex index.php index.html index.htm
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
Redirect permanent/http://www.example.com/
RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
ErrorLog /home/webroot/example.com/logs/error_log
CustomLog /home/webroot/example.com/logs/access_log combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/webroot/example.com/htdocs
ServerName www.example.com
RewriteEngine on
Redirect permanent/http://www.example.com/
RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
ErrorLog /home/webroot/example.com/logs/error_log
CustomLog /home/webroot/example.com/logs/access_log combined
RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
這也沒有效果(正面或負面)。絕對不是DNS緩存問題。似乎和 VirtualHost>之間的所有內容都被忽略了...... –
Stumbler
我編輯了我的答案看看是否有幫助,也不要忘記重新啓動httpd –
感謝您的幫助。我意識到問題所在。 default-ssl.conf僅用於使用ssl進行配置,並且在該階段告訴它有關http的任何信息已爲時太晚。你描述的代碼,如果放在000-default.conf(ubuntu服務器14.4)中,可以。 – Stumbler