www Redirect Checker


Enter a URL



About www Redirect Checker

Many websites on the Internet are accessible with or without the input of "www.". What sounds practical from the user's point of view has serious consequences for the ranking of a website in search engines like Google.

The reason for this is that due to the different URL variants, the entire website is put online under two domains. This in turn leads to internal duplicate content, which makes it difficult for the Google bot to index the website correctly because it does not know which page is more relevant for a particular search query. In addition, Google interprets links that actually refer to the same website (but once with and once without www.) as links to separate pages, which distributes the link power between the two domains. Thus, both domains rank worse than would be the case if the link power were bundled on one variant of the website.

Apart from the relevance for search engine optimization, the restriction to a preferred domain (either with or without www.) is also part of a clean technical setup of a website and therefore mandatory for every webmaster.

Possible solutions

If a website can be accessed both with and without www., you should always set up a 301 forwarding to the preferred domain. The HTTP status code 301 - Moved permanently - informs the browser that the requested file has been permanently moved to another URL and that the URL entered is no longer valid.

When using the Apache web server, one option is to set up forwarding through a .htaccess file. For this purpose, the following source code must be saved as a .htaccess file or inserted into an already existing .htaccess file in order to forward example.com to www.example.com

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

If you always want to redirect to the version without www instead, the URL has to be inserted without www.

Another variant, which leads to the same result, but is much simpler and better suited, is the setup of forwarding via a vHost configuration. This looks like this:

<VirtualHost *:80>
: ServerName example.com
: Redirect permanent / http://www.example.com/
</VirtualHost>

<VirtualHost *:80>
: ServerName www.example.com
: # real server configuration
</VirtualHost>

In addition to the 301 forwarding, the preferred domain should always be specified in the Google Search Console (under website settings → "Preferred domain"). Google uses this information for all future crawling and indexing. In addition, the search engine automatically follows links pointing to example.com, for example, as if they were pointing to www.example.com . The entry in the Google Search Console is therefore a useful addition to the 301 forwarding.

Another way to address the problem of duplicate content is to set a Canonical link to the preferred or canonical URL. The problem with this approach, however, is that although search engines are referred to the correct domain, the visitors to the website are not forwarded. For this reason, the Canonical Link is less suitable for solving this problem.

More tips for the WWW Redirect

An important aspect that should be checked when setting up a 301 redirection is that not only the home page, but also all subpages are redirected to the correct domain. In addition, the different network protocols (http and https), which can also be the cause of duplicate content, should also be taken into account as part of the redirect. For example, https://example.com as well as http://example.com and http://www.example.com should forward to https://www.example.com.