0
我對改變apache設置和修改httpd.conf很新。我已經安裝了SSL,並試圖將動態子域重定向到HTTPS。apache http重定向到https多重rewriteconditions
<VirtualHost *:80>
ServerName catchall.mydomain.com
ServerAlias *.mydomain.com
VirtualDocumentRoot /var/www/html/places/
Options -MultiViews
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /places/index.php?request=$1 [L]
</VirtualHost>
<VirtualHost *:443>
ServerName catchall.mydomain.com
ServerAlias *.mydomain.com
DocumentRoot /var/www/html/places/
SSLEngine on
SSLCertificateFile /SUPERSECRET
SSLCertificateKeyFile /SUPERSECRET
SSLCertificateChainFile /SUPERSECRET
</VirtualHost>
如果我去example.mydomain.com頁面確實加載,但它不重定向HTTPS。我已經嘗試了改變重寫條件和規則的位置的多種變體,並且在進行更改後我重新啓動了我的httpd服務。任何幫助是極大的讚賞。