How to Redirect WWW to non WWW WordPress [htaccess snippet]

  • read

code snippet

Below are two code recipes for your htaccess file to redirect different versions of your domain. Once you have things added you can use this redirect testing tool to verify all the versions of your domain are redirecting properly.

If you don’t want the WWW

Redirect everything to naked domain https://yourdomain.com

 

If you want the WWW

Redirect everything to https://www.yourdomain.com

 

Written by: Jacob Lett - Jacob is a HubSpot CMS designer & developer who helps B2B businesses grow their revenue. Unlike his competitors, he focuses on small and consistent website design changes to increase results. He recently created the Industrial HubSpot Theme to help manufacturers quickly build their website on the HubSpot CMS platform. Connect on LinkedIn
Category: Code Snippets
Tags: , ,