Redirect all pages to non-www and HTTPS in WordPress

To redirect all URLs from www to non-www and also to redirect from http to https, this code snippet to be added to .htaccess file at the top should do the trick.
So https://example.com
# BEGIN Redirects RewriteEngine On # 301 redirect www to non-www RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] # 301 redirect to https RewriteCond %{HTTPS}
Leave a Reply