In part one of "The UV SEO Series", I introduced the series and didn't get into anything specific. This is part two and the beginning of the onsite SEO portion of the series. It's longer than I anticipated so please, take your time.
One Website Address
How many ways can someone reach your website's home page? Do you, or do you not, use "www." in front of the domain name? Wouldn't it make sense to make sure the search engines, as well as people, can find your website at only one address?
What about your individual pages or posts? If you use pretty permalinks, do they all end with "/", just like the home page should? If your home page address starts with "www.", shouldn't the individual pages and posts start the same way?
The search engines are pretty good about indexing websites the way you intend, but why allow them to make mistakes? If you want a page to rank high in the SERPS, wouldn't it be easier if the page is being indexed with one address instead of two, three or four?
A few short months after I started this blog, I found my website listed by various search engines in four different ways:
- untwistedvortex.com
- untwistedvortex.com/
- www.untwistedvortex.com
- www.untwistedvortex.com/
I also found individual blog posts with either the trailing slash in place or not in place — two different URLs for each post. Would you believe that some addresses had higher rankings than the competing addresses? I believe one consistent format would have ranked better than all the different versions combined.
Most web servers automatically tack on the trailing slash, but not all of them. Most web servers also redirect to the appropriate page, with or without "www.", but then again, not all of them. I can't count how many broken links I've encountered due to server inconsistencies.
The simple solution is to make sure your website always points to the correct locations. The most popular website software packages either have this feature built in or the feature can be enabled with various plugins or add-ons. There are two other ways: The .htaccess file for web servers that support it or a simple PHP script.
The .htaccess code requires mod_rewrite to be turned on at the web server (it is on most). The code to force a redirection to the "www." or non-www version of the address looks like this:
Add www:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^untwistedvortex.com$
RewriteRule ^(.*)$ http://www.untwistedvortex.com/$1 [R=301,L]
</IfModule>
Remove www:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.untwistedvortex.com$
RewriteRule ^(.*)$ http://untwistedvortex.com/$1 [R=301,L]
</IfModule>
Here's the code to force a trailing slash. Insert it below the current "RewriteRule" above (use this only if your pages don't end with an extension):
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
This is a PHP script that will do it if you don't have .htaccess to work with. Insert it at the top of the page before anything else and un-comment the appropriate lines (and delete unused commented lines):
<?php
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI'];// to redirect to non-www URL
// if (substr($host,0,4) == 'www.') $url = substr($host,4);// to redirect to www URL
// if (substr($host,0,4) != 'www.') $url = 'www.' . $host;// remove home page from URL and force trailing slash
// change 'index.php' below to whatever your home page actually is
// if (strstr($uri, '/index.php') && substr($host, -1) != '/') $url = $host . '/';// force trailing slash on individual pages (if extensions aren't used)
// if (strstr($uri, '/') && substr($uri,-1) != '/') $url .= '/';header ("Location: http://$url,TRUE,301");
exit;
?>
Coming in Part Three
Part three will cover internal linking strategies. It may not seem important, but I'll point out more than one reason to develop a consistent internal linking strategy.
If you don't want to miss anything, make sure you subscribe to my daily, full articles by email.



