{"id":561,"date":"2021-10-15T10:06:55","date_gmt":"2021-10-15T10:06:55","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/cpanelhow-to-redirect-non-www-urls-to-www\/"},"modified":"2026-03-09T19:19:03","modified_gmt":"2026-03-09T19:19:03","slug":"redirect-non-www-urls-www","status":"publish","type":"post","link":"\/ng\/tutorials\/redirect-non-www-urls-www\/","title":{"rendered":"How to redirect non-www to www URLs"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>As a website owner, you might have wondered whether using a www or non-www website domain is simply a matter of user preference.<\/p><p>Even though a non-www domain may be simpler and easier for your audience to remember, it has some disadvantages compared to a www domain.<\/p><p>A www domain helps avoid both the possibility of split page ranking or split inbound links and any duplicate content when search engines index the site. Thus, it improves your site&rsquo;s search engine optimization (SEO).<\/p><p>If you use a non-www URL, redirecting it to www may seem intimidating, but it&rsquo;s not a complicated process. Keep reading, as this article will show you three different methods to redirect non-www to www URLs.<\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/How-to-Speed-Up-Your-Website-EN.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69260\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><p>\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-redirect-non-www-urls-to-www\">Why Redirect Non-www URLs to www?<\/h2><p>Sticking with a non-www domain has some drawbacks, including the lack of overload protection and control over cookies.<\/p><p>Traffic from non-www domains can&rsquo;t be redirected to another server because they don&rsquo;t have a <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4738777-how-to-add-and-remove-cname-records-on-hpanel\">CNAME record<\/a>. Due to that, if your server experiences an overload, you won&rsquo;t be able to redirect traffic to a healthy server.<\/p><p>Thus, visitors may have a hard time accessing your website, negatively affecting its <a href=\"\/ng\/tutorials\/website-performance\/\">performance<\/a> and SEO.<\/p><p>In addition to that, search engines consider <strong>https:\/\/www.yourdomain.com<\/strong> and <strong>http:\/\/yourdomain.com<\/strong> different websites. Therefore, they are ranked separately and require distinct SEO strategies.<\/p><p>Also, with a non-www domain, you can&rsquo;t use a <a href=\"\/ng\/tutorials\/cookieless-domain-warning\/\">cookie-free subdomain<\/a> unless you create a separate domain to deliver static content.<\/p><p>On the other hand, a www URL allows you to restrict cookies to the root domain or a specific subdomain, reducing the number of HTTP requests and improving the performance of the website.<\/p><h2 class=\"wp-block-heading\" id=\"h-redirecting-non-www-urls-to-www\">Redirecting Non-www URLs to www<\/h2><p>There are several ways to redirect non-www URLs to www &ndash; via your hosting account&rsquo;s control panel, a <a href=\"\/ng\/tutorials\/what-is-cdn\/\">content delivery network<\/a> (CDN), or web server software.<\/p><p>To avoid losing your ranking power, we recommend performing a permanent 301 redirect instead of a temporary one.<\/p><p>    <div class=\"announcement-block announcement-block--warning\">\n        <span class=\"announcement-block__heading\">\n            <svg width=\"24\" height=\"26\" viewBox=\"0 0 24 26\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                d=\"M12 23.5C17.799 23.5 22.5 18.799 22.5 13C22.5 7.20101 17.799 2.5 12 2.5C6.20101 2.5 1.5 7.20101 1.5 13C1.5 18.799 6.20101 23.5 12 23.5ZM13.637 8.65198C13.637 7.74791 12.9041 7.01501 12 7.01501C11.0959 7.01501 10.363 7.74791 10.363 8.65198C10.5335 10.5375 10.875 14.383 10.875 14.383C10.875 15.0043 11.3787 15.508 12 15.508C12.6213 15.508 13.125 15.0043 13.125 14.383V14.38L13.637 8.65198ZM11.9927 16.714C11.3714 16.714 10.8677 17.2177 10.8677 17.839C10.8677 18.4603 11.3714 18.964 11.9927 18.964H12.0073C12.6286 18.964 13.1323 18.4603 13.1323 17.839C13.1323 17.2177 12.6286 16.714 12.0073 16.714H11.9927Z\"\n                fill=\"#BE1025\"\/>\n            <\/svg>\n            Warning        <\/span>\n        <p class=\"announcement-block__content\">\n            <b>Warning!<\/b> Before proceeding to the tutorial, make sure you have a backup of your website files. This way, you can restore the site to a previous version if an error occurs during the process.        <\/p>\n    <\/div>\n\n    \n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-hpanel\">hPanel<\/h3><p>The easiest way of redirecting a non-www URL to www is to place a rule in the <strong>.htaccess <\/strong>file. You can do so via<a href=\"\/ng\/tutorials\/what-is-ftp\/\"> FTP<\/a>,<a href=\"\/ng\/tutorials\/ssh-tutorial-how-does-ssh-work\/\"> SSH<\/a>, or your hosting account&rsquo;s control panel.<\/p><p>hPanel users can easily access and edit the <strong>.htaccess<\/strong> file. Here are the steps to do it:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your <strong>hPanel<\/strong>, scroll down to the <strong>Files <\/strong>section, and open the <strong>File Manager<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"522\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\/public\" alt=\"The File Manager option on hPanel\" class=\"wp-image-80655\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\/w=448,fit=scale-down 448w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\/w=257,fit=scale-down 257w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-sidebar-1.png\/w=129,fit=scale-down 129w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"2\">\n<li>Navigate to the <strong>public_html<\/strong> directory, right-click the <strong>.htaccess <\/strong>file, and select <strong>Edit<\/strong>.<strong> <\/strong>If you can&rsquo;t find it, refer to our article to learn <a href=\"\/ng\/tutorials\/locate-and-create-htaccess\/\">how to create the .htaccess file<\/a> for your WordPress site.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"203\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\/w=1024,h=1024,fit=scale-down\" alt=\"The public_html directory on hPanel with the Edit option highlighted\" class=\"wp-image-80753\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-edit.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"3\">\n<li>Find the line <code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteEngine On<\/code><strong> <\/strong>and insert the following code after it:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteRule ^(.*)$ http:\/\/www.yourdomain.com\/$1 [L,R=301]<\/code><\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-htaccess.png\"><img loading=\"lazy\" decoding=\"async\" width=\"463\" height=\"85\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-htaccess.png\/public\" alt=\"RewriteEngine On code line highlighted along with the inserted code.\" class=\"wp-image-80761\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-htaccess.png\/w=463,fit=scale-down 463w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-htaccess.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-files-filemanager-public_html-htaccess.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 463px) 100vw, 463px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"4\">\n<li>Don&rsquo;t forget to replace <strong>yourdomain.com<\/strong> with your actual domain name<strong>.<\/strong> Once you&rsquo;re done, <strong>save <\/strong>the changes.<\/li>\n<\/ol><p>This <strong>.htaccess<\/strong> rule will now redirect all visitors from the non-www to the www version of your website.<\/p><h3 class=\"wp-block-heading\" id=\"h-cpanel\">cPanel<\/h3><p><a href=\"\/ng\/tutorials\/what-is-cpanel\/\">cPanel<\/a> users can redirect non-www URLs to www via the <strong>Redirect<\/strong> settings or editing the <strong>.htaccess<\/strong> file. If you are a beginner, we recommend following the first method:<\/p><ol class=\"wp-block-list\">\n<li>Access your <strong>cPanel<\/strong>, then navigate to <strong>Domains <\/strong>-&gt;<strong> Redirects<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\"><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"192\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\/public\" alt=\"The Redirects menu on cPanel\" class=\"wp-image-80771\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\/w=777,fit=scale-down 777w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"2\">\n<li>Under <strong>Type<\/strong>, select the <strong>Permanent (301)<\/strong> option.<\/li>\n\n\n\n<li>On <strong>https?:\/\/<\/strong>, enter the domain you want to redirect. Leave the path section (\/) empty.<\/li>\n\n\n\n<li>In the <strong>Redirects to<\/strong> field, type in your website&rsquo;s www URL.<\/li>\n\n\n\n<li>Select <strong>Do Not Redirect www<\/strong>, and uncheck <strong>Wild Card Redirect<\/strong>.<\/li>\n<\/ol><ol class=\"wp-block-list\" start=\"6\">\n<li>Press the <strong>Add <\/strong>button.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"427\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Add Redirect section on cPanel's Redirects menu\" class=\"wp-image-80777\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-domains-redirects-addredirect.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>If the above method doesn&rsquo;t work, you can set the redirect manually by editing the <strong>.htaccess<\/strong> file:<\/p><ol class=\"wp-block-list\">\n<li>From your cPanel<strong> <\/strong>dashboard, go to <strong>Files<\/strong> -&gt;<strong> File Manager<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-files-filemanager.png\"><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"305\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-files-filemanager.png\/public\" alt=\"The File Manager menu on cPanel\" class=\"wp-image-80780\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-files-filemanager.png\/w=765,fit=scale-down 765w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-files-filemanager.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/cpanel-files-filemanager.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"2\">\n<li>Look for the <strong>public_html<\/strong> folder and double-click it.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1366\" height=\"653\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=1024,h=1024,fit=scale-down\" alt=\"public_html folder on cPanel\" class=\"wp-image-37860\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=1366,fit=scale-down 1366w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/public-html-folder.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"3\">\n<li>Right-click the <strong>.htaccess<\/strong> file and select <strong>Edit<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"490\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\/w=1024,h=1024,fit=scale-down\" alt=\"Editing the .htaccess file on cPanel\" class=\"wp-image-37861\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/edit-htaccess.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"4\">\n<li>Under <code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteEngine On<\/code>, insert the following lines of code:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteRule ^(.*)$ http:\/\/www.yourdomain.com\/$1 [L,R=301]<\/code><\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1366\" height=\"654\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=1024,h=1024,fit=scale-down\" alt=\"Redirect the code snippet on cPanel\" class=\"wp-image-37862\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=1366,fit=scale-down 1366w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/cpanel-code-snippet.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/figure><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Don&rsquo;t forget to replace yourdomain.com with your actual domain name.\n            <\/p><\/div>\n\n\n\n<\/p><ol class=\"wp-block-list\" start=\"5\">\n<li>Save Changes<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-cloudflare\">Cloudflare<\/h3><p>If you&rsquo;re planning on setting up a CDN like Cloudflare to improve the speed and performance of the site, you will also be able to use it to redirect the non-www to the www domain.<\/p><p><div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Expert Tip\n                <\/p>\n            <\/div>\n            <p class=\"protip__content\">You may want to check the following tutorials before proceeding:<br>\n<a href=\"\/ng\/tutorials\/how-to-setup-cloudflare-for-wordpress\/\">Cloudflare setup process for WordPress sites<\/a><br>\n<a href=\"\/ng\/tutorials\/improving-website-performance-using-a-cdn\/\">Cloudflare setup tutorial for general websites<\/a><\/p>\n                <div class=\"protip__expert\">\n                    <div class=\"protip__expert-image\">\n                        <img loading=\"lazy\" decoding=\"async\" width=\"48\" height=\"48\" src=\"https:\/\/secure.gravatar.com\/avatar\/96cd154ae688d7a15a7d0d0e65a85234281f31e2b23b34b93d5cd081271defc2?s=65&d=mm&r=g\" alt=\"Editor\" \/>\n                    <\/div>\n                    <div>\n                        <p class=\"protip__expert-name\">Darius G.<\/p>\n                        <p class=\"protip__expert-position\">Chief Customer Officer<\/p>\n                    <\/div>\n                <\/div>\n        <\/div>\n\n\n\n<\/p><p>Once you&rsquo;ve created an account, log in, and set up a <a href=\"\/ng\/tutorials\/cloudflare-page-rules\/\">page rule on your Cloudflare<\/a>:<\/p><ol class=\"wp-block-list\">\n<li>On your <strong>Cloudflare dashboard<\/strong>, click on the <strong>Rules<\/strong> tab.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/The-Rules-menu-on-the-Cloudflare-dashboard.png\"><img loading=\"lazy\" decoding=\"async\" width=\"249\" height=\"567\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/The-Rules-menu-on-the-Cloudflare-dashboard.png\/public\" alt=\"The Rules menu on the Cloudflare dashboard\" class=\"wp-image-80794\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/The-Rules-menu-on-the-Cloudflare-dashboard.png\/w=249,fit=scale-down 249w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/The-Rules-menu-on-the-Cloudflare-dashboard.png\/w=132,fit=scale-down 132w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/The-Rules-menu-on-the-Cloudflare-dashboard.png\/w=66,fit=scale-down 66w\" sizes=\"auto, (max-width: 249px) 100vw, 249px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"2\">\n<li>Press the <strong>Create Page Rule<\/strong> button.<\/li>\n\n\n\n<li>Type in your current website URL without the www, then set the page rule as <strong>Forwarding URL<\/strong>.<\/li>\n\n\n\n<li>Select <strong>301 &ndash; Permanent Redirect<\/strong> as the status code.<\/li>\n<\/ol><figure class=\"wp-block-image size-full\"><a href=\"\/ng\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"483\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\/public\" alt=\"Creating a page rule on Cloudflare\" class=\"wp-image-37864\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\/w=935,fit=scale-down 935w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/10\/page-rule.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/a><\/figure><ol class=\"wp-block-list\" start=\"5\">\n<li>Type in your website&rsquo;s URL with the www, then click <strong>Save and Deploy<\/strong>.<\/li>\n<\/ol><p>Wait for the redirect to go live.<\/p><h3 class=\"wp-block-heading\">NGINX<\/h3><p>If you use <a href=\"\/ng\/vps-hosting\">virtual server hosting<\/a> and <a href=\"\/ng\/tutorials\/what-is-nginx\/\">NGINX<\/a>, follow the tutorial below to redirect non-www URLs to www:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your VPS account using an SSH like <a href=\"\/ng\/tutorials\/how-to-use-putty-ssh\/\">PuTTY<\/a>.<\/li>\n\n\n\n<li>Navigate to the directory <strong>\/etc\/nginx\/<\/strong>.<\/li>\n\n\n\n<li>Type in the command below to view the directory content:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">[server]$ sudo ls - la<\/code><\/li>\n\n\n\n<li>Enter your NGINX password.<\/li>\n\n\n\n<li>Type in the following command to edit the nginx.conf file:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">[server]$ sudo nano nginx.conf<\/code><\/li>\n\n\n\n<li>Add the following lines of code, replacing yourdomain.com with your actual domain name:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">server {<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">server_name yourdomain.com;<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">return 301 $scheme:\/\/www.yourdomain.com$request_uri;<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">}<\/code><\/li>\n\n\n\n<li>Enter the following command to restart the NGINX web server:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo systemctl restart Nginx<\/code><\/li>\n<\/ol><p>In addition to redirecting non-www to www URLs, you can also <a href=\"\/ng\/tutorials\/nginx-redirect\/\">run other redirects through NGINX<\/a>, such as HTTP to HTTPS and other page redirects.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">Hostinger users can manage their VPS from the new browser-based terminal, eliminating the need for additional software.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h3 class=\"wp-block-heading\">Apache<\/h3><p>If you&rsquo;re a VPS and <a href=\"\/ng\/tutorials\/what-is-apache\/\">Apache<\/a> user, you&rsquo;ll also need to edit the <strong>.htaccess<\/strong> file. Just like the previous tutorial, it can be done via an SSH terminal.<\/p><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Before continuing with the steps below, make sure you have root access with <a href=\"\/ng\/tutorials\/sudo-and-the-sudoers-file\/\">sudo privileges<\/a> and a text editor like <a href=\"https:\/\/www.nano-editor.org\/\">Nano<\/a>.\n            <\/p><\/div>\n\n\n\n<\/p><p>By default, Apache doesn&rsquo;t allow the use of <strong>.htaccess<\/strong> file, so the steps will be a little different:<\/p><ol class=\"wp-block-list\">\n<li><strong>Enable mod_rewrite<\/strong> by running the following command:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">$ sudo a2enmod rewrite<\/code><br>Then, restart the Apache web server:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">$ sudo systemctl restart apache2<\/code><\/li>\n\n\n\n<li><strong>Enable .htaccess<\/strong> with the command:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">$ sudo vi \/etc\/apache2\/sites-available\/000-default.conf<\/code><br>Add the following code before the <code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">&lt;VirtualHost&gt;<\/code> line:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">&lt;Directory \/var\/www\/html&gt;<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">Options Indexes FollowSymLinks MultiViews<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">AllowOverride All<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">Require all granted<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">&lt;\/Directory&gt;<\/code><br>Then, restart Apache.<\/li>\n\n\n\n<li>To create the<strong> .htaccess<\/strong> file, enter the command:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">$ sudo vi \/var\/www\/html\/.htaccess<\/code><\/li>\n\n\n\n<li>Add the following lines to the file:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteEngine on<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">RewriteRule ^(.*)$ http:\/\/www.yourdomain.com\/$1 [L,R=301]<\/code><\/li>\n\n\n\n<li>Restart the Apache server.<\/li>\n<\/ol><p>All site visitors using the non-www URL should now be redirected to the www version.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>People tend to leave the www out when typing a website&rsquo;s address. It might not cause significant issues since visitors will reach the same page, but it&rsquo;s best to redirect site visitors to its www version.<\/p><p>This is because your site&rsquo;s performance and SEO might be affected if you keep using non-www domains.<\/p><p>Though it may sound complicated, the redirect process will only take a minute or two. In this article, you&rsquo;ve learned how to redirect non-www URLs to www in several ways:<\/p><ul class=\"wp-block-list\">\n<li>Via your hosting account&rsquo;s control panel &ndash; hPanel and cPanel.<\/li>\n\n\n\n<li>Using Cloudflare.<\/li>\n\n\n\n<li>For VPS users, via NGINX and Apache.<\/li>\n<\/ul><p>Now, whenever someone accesses your site using <strong>http:\/\/yourdomain.com<\/strong>, they will be redirected to <strong>http:\/\/www.yourdomain.com<\/strong>.<\/p><p>We hope this article was helpful. Let us know in the comments below if you have any questions.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Suggested Reading                <\/p>\n            <\/div>\n            <p class=\"protip__content\">Check out our tutorial featuring <a href=\"\/ng\/tutorials\/website-optimization-tools\/\">The Best Tools For Website Optimization<\/a>, ensuring a smoother and more engaging user experience.<\/p>\n                    <\/div>\n        \n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a website owner, you might have wondered whether using a www or non-www website domain is simply a matter of user preference. Even though a non-www domain may be simpler and easier for your audience to remember, it has some disadvantages compared to a www domain. A www domain helps avoid both the possibility [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/redirect-non-www-urls-www\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":24,"featured_media":144718,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Easily Redirect Non-www websites to www","rank_math_description":"Using non-www domains may affect your site\u2019s performance and SEO. In this tutorial, learn different ways to redirect non-www URLs to www.","rank_math_focus_keyword":"redirect non-www to www","footnotes":""},"categories":[22630],"tags":[],"class_list":["post-561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-aspects"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/redirection-non-www-vers-www","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-redirigir-una-url-sin-www-a-www","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-redirect-non-www-to-www","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-redirigir-una-url-sin-www-a-www","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-redirigir-una-url-sin-www-a-www","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-redirigir-una-url-sin-www-a-www","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/redirect-non-www-urls-www","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/redirect-non-www-urls-www","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=561"}],"version-history":[{"count":39,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/561\/revisions"}],"predecessor-version":[{"id":144717,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/561\/revisions\/144717"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/144718"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}