How to force redirect HTTP to HTTPS in WordPress via htaccess

Apache, PHP , 0 Comments

Warning: Trying to access array offset on value of type null in /home/codenski/public_html/wp-content/themes/simple-east/content.php on line 37

It’s thinkable for a user to enter in a direct HTTP URL on your WordPress site, even when an SSL certificate is active. To force any HTTP request to redirect to HTTPS, you can add following code to your WordPress .htaccess file.

RewriteEngine On 
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
how-to-force-redirect-http-to-https-in-wordpress-by-htaccess

At last, There are given below final script for htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


Warning: Trying to access array offset on value of type null in /home/codenski/public_html/wp-content/themes/simple-east/content.php on line 74

Leave a Reply

Your email address will not be published.