A constant question that comes to a website owners’ mind is – what to choose between www or non-www URL. In the HTTP URL, the first substring is the domain name. The domain name is generally hosted on the server where the document resides.
A server is not a single physical machine, as several servers can reside on the same system. It is vital to choose one domain as a canonical one. There are two ways to choose a site that is canonical.
One way is to use HTTP 301 redirects, and the other method is to use a link-canonical. You can redirect a non-www URL to a www version of your website with a .htaccess file.
Why Redirect files from non-www to www URLs?
Domains without www or with www are different, but they redirect you to the same website. Having two different URLs for web pages can hurt the ranking of your website. This is why having a uniform URL for all pages is important.
Redirecting a non-www to www URLs can be tricky. But if you know the steps, it won’t take much time. Redirecting to www URLs is beneficial for SEO purposes. By redirection, you will avoid duplicate content on the Google index and prevent split inbound links on the website.
2. Non-www or WWW – Which to Choose?
If you have to choose between redirecting a www page to non-www or a non-www to www, you need to pick one according to your website requirements. Most sites consider redirecting to the www version from the non-www version for better exposure and security.
- Popular websites like Google, Wiki, and Yahoo redirect their page to the www version.
- Most users also use www when they spell out a website. For example, when you tell someone about a new website, you give the reference of www, right?
Www stands for World Wide Web, which is a part of the domain name itself. Most websites you see on the internet have traditionally made www a part of their domain. Non-tech users use www in the browser address as they relate to it.
But some sites use the non-www version for easy access or to make the website stand out from other websites.
Want to buy a domain name? Use these HostGator domain coupons to get a discount.
#URL rewrite with .htaccess file
Rewrites can be similar to the redirects as they also point out the target to the URL. But some are converted by the web servers while handing the traffic of the website. You think of it as using a pencil and rubber against using sign point to the new name. The most common rewrites force the websites to have URLs.
.htaccess file uses the actual page to redirect your website. It can use 301 and 302 redirects. But the most effective way to redirect a URL is with the .htaccess file. After you complete the process, check your site on the internal pages.