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

 

New Industrial HubSpot Theme Released

Do you use HubSpot just for a blog or landing pages? No problem. this HubSpot theme contains the most common types of landing pages and a robust blog template to get you started. Learn More

Written by: Jacob Lett - Jacob is a marketing and web design consultant who helps manufacturers 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 platform.
Category: Code Snippets
Tags: , ,

Want to Get Email Updates?

Receive a monthly digest of new tutorials and resources.