Non www to www Redirection WordPress on Hostgator

My experience to redirect non www to www on WordPress and Hostgator. Check with your hosting provider if not Hostgator.

After activating SSL (https) now its time to redirect from non www to www. This is optional you can redirect non www to www or redirect www to non www (naked domain), depends on your preferences.

The website is based on WordPress CMS version 5.3.2 and using Hostgator as the hosting company. On their manual here said that I need to add

RewriteCond %HTTP_HOST} ^domain.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

on the .htaccess file (I edit this file via the file manager on CPANEL)

When I add the code it doesn’t changed, it still redirect no non www. I didn’t understand why the code is not redirecting. I am sure that the code is correct because the source is from HostGator itself.

Then I check with http://www.redirect-checker.org/ and found that the WordPress did the redirection. Knowing this I then logon to WordPress’s Darshboard and click on Settings – General.

I found it still using https://domainname.com on WordPress address and Site address section. Then I changed both to https://www.domainname.com

check redirection status

When I check it’s now working correctly as I want it to.

Share Article:

Thomass Miller

Writer & Blogger

A passionate writer and blogger with a knack for crafting compelling narratives that inspire and connect. His love for marketing and technology shines through in his work, as he seamlessly blends innovation and creativity into every project. Thomas thrives on building meaningful relationships, fostering harmony, and sparking engaging discussions that leave a lasting impact. A dynamic storyteller at heart, he finds joy in discovering new ideas and sharing them with enthusiasm, creating content that bridges the gap between people, ideas, and technology.

Leave a Reply

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

Edit Template

© 2024 

muncheye mcdougallinteractive SMM