Simple step by step guide to redirect HTTP TO HTTPS in APACHE on RHEL/Centos/Oracle linux (5-6-7)


In this article we learn how to redirect HTTP to HTTPS in APACHE on linux. Https is used to transfer data over internet securely. To enhance the security we need to force redirection from http to https.

To do this redirection first we need to configure SSL Certificate in the linux sytem and we need to enable one module mod_rewrite. If this module is not enable in linux system we need to edit apache configuration file and enable the mod_rewrite module.

Method to redirect HTTP TO HTTPS in APACHE  on RHEL/Centos/Oracle linux (5-6-7)

We have two method to redirect HTTP to HTTPS in APACHE on linux system.

METHOD1: we edit the APACHE configuration file and add the below line.suppose our domain name is www.example.org

Redirect permanent / https://www.example.org/

METHOD2: We edit the APACHE configuration file and also add the below lines under the Document Root section

  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Simple step by step guide to redirect HTTP TO HTTPS in APACHE  on RHEL/Centos/Oracle linux (5-6-7)

Simple step by step guide to redirect HTTP TO HTTPS in APACHE  on RHEL/Centos/Oracle linux (5-6-7)


Recommended Read: https://techrideradmin.blogspot.com/2018/12/simple-step-by-step-guide-to-configure-SSL-for-APACHE-webserver-in-linux-RHEL-Centos-Oracle-5-6-7.html

Now restart the APACHE webserver using the below command
For linux(5/6)
#service httpd restart
For linux7
#systemctl restart httpd

Now open the browser and type http://server ipaddress  and it will be redirect to https.

That’s all if this article is helpful to know about redirect http to https please share this  article!!!!!!!

SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment