Set HTTP to HTTPS redirection in 2 sec in Linux Apache server

Set HTTP to HTTPS redirection in 2 sec in Linux Apache server

Hello Friends,

Hope you are doing well.

In this post, I will show you how you can easily set the redirection from HTTP to HTTPS of a website in  Linux Apache server.

The step is really very simple and it will take only 2 sec to set it. This post is really helpful, if you do not have any control panel and want to set the redirection quickly.

To set the redirection, you need to add the below code in the .htaccess file.

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.beanexpert.co.in/$1 [R,L]

Replace “beanexpert.co.in” with your required domain name. Save the file and you are all set.

Please try this and let me know if you face any issue in setting this.

  • Note: The above redirection code will only work if your site is listening to port 80

Thank you. 🙂

 

Powered by Facebook Comments

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.