Use a Consistent Home Page URL

There are (at least) two ways you can access a typical home page. Both these methods will display the same thing:

  1. The URL of the domain, e.g. www.example.com. The "www" is optional (see below).
  2. The full URL of the home page, e.g. www.example.com/index.html or www.example.com/home.php, etc. The exact URL will depend on your setup.

In general it's best to avoid duplicate URLs for the same page (this applies to any page, not just the home page). Although search engines are usually smart enough to spot duplicates and try to determine the "official" version, you shouldn't rely on this. It makes sense to have one single, unambiguous URL for the home page.

There are other non-SEO reasons for doing this too. For example:

So, there are three things you need to do.

(1) Choose a consistent subdomain (e.g. "www")

The subdomain is the part of a URL before the domain name—in most cases it's "www". However you can also use your domain with a different subdomain (e.g. blog.example.com) or no subdomain at all (e.g. example.com). Decide which subdomain (if any) you're going to use and then make sure your server always redirects other subdomains to that one.

To test this, enter your domain name into your browser's address bar without any subdomain (e.g. http://example.com) and hit Enter. If the URL automatically changes to include the "www" or some other subdomain, then you're already set up. Assuming it's the subdomain you want, skip to the next step. If it stays the same, you'll need to set up a redirect.

If you have an Apache server, you can (probably) achieve this by adding the following lines to your .htaccess file (remember to change example.com to your own domain):

RewriteEngine on
# Redirect users to "www" if necessary:
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

If you can't figure this out by yourself, contact your host or server administrator and ask them do organize it for you.

(2) Make sure your web server displays your home page as the domain URL by default.

To test, enter your domain name into your browser's address bar and hit Enter. If it stays the same or only adds a forward-slash to the end (e.g. www.example.com/), then all is good and you can skip to the next step.

If it changes to a longer URL, you will need to do some investigating of your own. Every web server is different and we can't any offer any specific advice on how to fix your case. The most likely cause is that your CMS does this by default. Contact the person who manages the technical side of your website and ask for help. Direct them to this page if you like. Please understand that some systems may not be able to fix this issue, in which case you'll need to decide if it's worth changing your entire management system for this particular benefit.

(3) Make sure all the internal links in your website point to the correct URL.

Again, there are two ways you can link to your home page from within your site: (1) The actual home page file, or (2) the document root, which is effectively the same as the domain URL.

Examples of links to the home page (not recommended)

Examples of links to the root URL (recommended)

Summary

If you make the link to your home page consistent throughout your entire website, you're adding to the strength and robustness of your most important URL.

NOTE: You can apply this same principle to other directories in your site. Each folder should have an equivalent "home page" that is displayed by default, e.g. www.example.com/about/ > www.example.com/about/index.html. Which option you choose is up to you, but try to be consistent.