How to redirect url in apache ubuntu linux

http to https redirection

<VirtualHost *:80>
ServerName abc.com
RewriteEngine on
SSLEngine on
Redirect / https://abc.com
</VirtualHost>

Redirection https url https://www.abc.com to https://abc.com

<VirtualHost *:443>
ServerName www.abc.com
RewriteEngine on
SSLEngine on
Redirect / https://abc.com
SSLCertificateFile /etc/letsencrypt/live/abc.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/abc.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

Post a Comment

Mới hơn Cũ hơn