A recurring question among website owners is whether to choose non-www or www URLs. If you’re using a non-www URL, redirecting it to www may sound daunting, but it’s not difficult. Continue reading to learn about the easiest way to redirect non-www URL to www URL.
Running your website on www or non-www URLs may be for aesthetic reasons, personal preference, or to prevent redundant host names. It is recommended that you keep the host name of your website the same throughout. Either with the www part or without the www part.
HOW TO REDIRECT NON WWW TO WWW FOR A WORDPRESS WEBSITE?
- To redirect a website, go to htacessredirect.net.
- Then, in the box below, write the name of your website which does not have www.
- Then scroll down to the end of the page and click on “Generate Code”.
- Now you will be getting a code on the screen.
- Here we have 2 options where the first one is to redirect temporarily, which will be valid only up to 90 days and the second alternative is redirecting permanently.
- You can make this change in the code where r=301 is permanent and r=302 is temporary redirecting.
- Now copy that code and paste it in a notepad and save it as .htaccess.
- Now submit this file to the root folder.
WRAPPING UP:
In this article, we have the easiest way of redirecting non-www to www for a WordPress website. When using several domains, switching to a newly purchased domain, or trying to avoid 404 error pages, redirecting URLs is a wonderful way to avoid complications caused by duplicating content. If you like how it looks, or you want to be 100% sure that people who know your brand name can find you, go ahead and add www to your WordPress site. Just make sure you follow the steps above to ensure it’s properly implemented. I hope you found this tutorial as simple as it really is. If you like this article, be sure to check out our WordPress video lessons on YouTube.