Having some trouble making all the pages on your WordPress site enforce HTTPS and go to the WWW variant? We are very sorry to hear that! Please try the following code above the default WordPress code.

# Force WWW and SSL
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The full .htaccess file will look like this! AWESOME!

# Force WWW and SSL
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

Brian Singer

Principal
With over 20 years of website development experience, Brian brings a wealth of knowledge around data processing, website hosting, high-level marketing strategy, SEO, and more. Brian is a graduate from the McDonogh School, holds a B.F.A. in Imaging Arts and Sciences from Rochester Institute of Technology and serves on the board of several non-profits.

Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Brian Singer

Principal
With over 20 years of website development experience, Brian brings a wealth of knowledge around data processing, website hosting, high-level marketing strategy, SEO, and more. Brian is a graduate from the McDonogh School, holds a B.F.A. in Imaging Arts and Sciences from Rochester Institute of Technology and serves on the board of several non-profits.

Post Details