12 September 2015

How to redirect your website from HTTP to HTTPS on Apache HTTP Web Server


HTTP to HTTPS
  • You can automatically redirect your website visitor from http://www.yourwebsite.com  to https://www.yourwebsite.com  in various ways. 
  • This blog post will show you how to redirect your website from http to https using a simple .htaccess file saved on your web server.
  • Step 1: Install & configure mod_ssl on your Apache HTTP Server.
  • Step 2: Enable the mod_rewrite modules by editing the ‘httpd.conf’ apache configuration file.
  • Step 3: create an ‘.htaccess’ file and write the following code on that .htaccess file & save the file on your web server document root directory.   
  
 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Pro Apache (Expert's Voice)

No comments:

Post a Comment

Featured Post

How to Write PHP code and HTML code within a same file

A PHP file can have both PHP code and HTML code together. Any HTML code written outside of PHP <?php //php code here… ?> Code is ig...

Popular Posts