0
我在Centos 7上有一個apache服務器。我也有一個miltidomain證書。 我想將https://old-domain.com重定向到https://new-domain.com。 從http重定向到https可以工作,但不能從https重定向到https。 我想在http或https中通過new-domain.com替換所有情況下的old-domain.com。 我不知道什麼是錯的。使用Apache Url從HTTPS重寫到另一個HTTPS
謝謝你在前進, Tony92
這裏是/etc/httpd/conf.d/mydom.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html"
ServerName myserver.new-domain.com
ServerAlias myserver
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)$ https://new-domain.com/$1 [L,R]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName myserver.new-domain.com
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^/(.*)$ https://new-domain.com/$1 [L,R]
SSLEngine on
# SSLProxyEngine On
SSLCertificateFile /etc/pki/tls/certs/myserver.crt
SSLCertificateKeyFile /etc/pki/tls/private/myserver.key
SSLCertificateChainFile /etc/pki/tls/certs/DigiCertCA.crt
SSLProtocol all -SSLv2
SSLHonorCipherOrder on
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>