Force HTTPS 301 redirect with hook

We can add https in very simple way…. No need to had code all these in any hook….

  1. Log in to wordpress admin
  2. Go to Settings > General
  3. Find WordPress Address (URL) and Replace HTTP with HTTPS
  4. Find Site Address (URL) and Replace HTTP with HTTPS
  5. Click Save Changes

Edit .htaccess file and add bellow code

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^huepixel\.com$ [NC]
RewriteRule ^ https://www.huepixel.com%{REQUEST_URI} [L,R=301]

Install wordpress-https Plugin and configure it….

That’s All