How to redirect from http to https using .htaccess ?

By | June 10, 2018

Redirect to https

If you want to redirect each request coming should go to https instead of HTTP without any plugin. then

Step1: Go to root directory of your website and look for .htaccess file. It should be exist in root directory.

Step2: Find the ‘RewriteEngine On’ Add the following code after that.

1
2
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Here yourdomain stands for website name for which you want to redirect to https.

Leave a Reply

Your email address will not be published. Required fields are marked *