• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Home
  • Blog
  • Sample Page

WordPress Tips

Just another WordPress site

Redirect all pages to non-www and HTTPS in WordPress

October 13, 2019 Leave a Comment

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}

Filed Under: .htaccess, ssl, WordPress Tagged With: .htaccess, ssl, WordPress

Reader Interactions

Related Posts

  • Media Temple Managed WordPress Hosting: Overview and Review
  • Hotjar Heatmap Analytics: An Overview and Review
  • How to Use a Heatmap to Improve Your Website’s Overall Quality
  • GreenGeeks Eco-Friendly Hosting: An Overview and Review

Leave a Reply Cancel reply

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

Primary Sidebar

Copyright ©2019 · WPress.Tips - All Rights Are Reserved · Powered by Genesis Framework