WWW and Non WWW Redirect Checker

Check that the WWW and non-WWW redirects are working properly.

What is WWW and Non WWW Redirect Checker?

Perform a canonicalization check on your URLs to ensure that everything is working as it should. For example, if bothhttps://www.example.comandhttps://example.comdisplay the same page but do not resolve to the same URL, then these URLs are examples of canonicalization. When this occurs, crawlers may become confused about which URL should be used for indexing purposes.

What is the difference between www and non-www?

www and non-www are commonly used to indicate whether or not a URL starts with "www."

For example, WWW URL:

  • https://www.example.com
  • URL without WWW:

  • https://example.com
  • How to fix?

    To fix the issue where http://example.com and http://www.example.com resolve to different URL, you can implement a 301 re-write rule in your.htaccess file. This will make both URLs redirect to the same location.

    301 redirect from www to non-www:

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

    301 redirect from non-www to www:

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