How to redirect http, www to https Secure

Your website using with Secure HTTPS and you are not redirect the http or http://www  to https properly or not configured, your website can access three different users and by seeing these urs Search Engine understand that there are three different websites having the same content / similar websites and you may drop your site ranking. So check your website ranking seo optimization and fix the issues.

So use below code .. copy and past into your .htaccess file (if you uses Apache server).

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

above code is the best one that works fine .. it redirect from http to https, and also http://www. to https://

This entry was posted in SEO and tagged , , . Bookmark the permalink.