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>
Share on Google Plus

About Md. Shahzad Alam

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment