Answer the question
In order to leave comments, you need to log in
How to redirect https traffic from a domain to another domain?
You need to redirect all traffic from one domain to another on the same server.
I do:
<VirtualHost *:80>
ServerName old-site.ru
Redirect / https://new-site.ru
</VirtualHost>
<VirtualHost *:443>
ServerName old-site.ru
Redirect / https://new-site.ru
SSLCertificateFile /etc/letsencrypt/live/old-site.ru/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/old-site.ru/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/old-site.ru/chain.pem
</VirtualHost>
RewriteEngine on
RewriteRule "^/?(.*)" "https://new-site.ru/$1" [R=301,L]
<VirtualHost *:443>
DocumentRoot /var/www/
ServerName new-site.ru
SSLEngine on
SSLCertificateFile /etc/ssl/private/4650089.crt
SSLCertificateKeyFile /etc/ssl/private/4650089.key
SSLCertificateChainFile /etc/ssl/private/new-site.ca-bundle
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Added the NameVirtualHosts *:443 line to apache2.conf - it worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question