How To Redirect Http To Https In Apache and Nginx

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-redirect-http-to-https-in-apache-nginx/
PINTEREST
PINTEREST
INSTAGRAM

Http is popular protocol used to transfer web page data like HTML, Javascript, Image etc. HTTP is used between our browser like Chrome, Firefox, Edge, Internet Explorer and server like Apache, Nginx etc. HTTPS is secure version of HTTP and recently sites transition to the HTTPS. But what is a user try to access HTTP of our web site. We can redirect HTTP web sites to the HTTPS. Below you can find redirect ways for different web servers.

Apache

Apache is very popular web server which is number 1 in internet. We can use HTTP 301 Redirect status code for this like below. But as we can see we need to enable RewriteEngine too.

Nginx

Nginx is another popular web server which gains momentum in last years. We can use following server configuration in order to redirect HTTP to HTTPS. We will use HTTP 301 Redirect status code with return option. Other part of the configuration is just example.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-redirect-http-to-https-in-apache-nginx/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  What Is Apache Web Server?