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

  • read
  • Add to Flipboard Magazine.

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 an experienced website designer and developer who specializes in building HubSpot CMS themes. He helps Industrial companies optimize and leverage their website for awareness, lead generation, and branding.
Category: Code Snippets
Tags: , ,

Want to Get Email Updates?

Receive a monthly digest of new tutorials and resources.