I'm running the current stable version of WordPress 2.1. The things I'm going to mention work with this version but I don't know if they will work with earlier versions. If you don't have access to the files on your server, as you don't when you're not self-hosted, this article will not pertain to your specific blog. If you should decide to become self-hosted, the information may be useful for you at that time — so bookmark it for future reference.

I'm fairly new to the SEO arena, being as how I knew nothing to start with and know very little now. I am learning, though. As I have been implementing changes to make my blog more attractive to search engines, I have avoided changing things that would have a negative impact on the people I link to or on the ability to navigate around my blog with ease.

In this first part of the series, I'm going to focus on the .htaccess file for the Apache web server. This file exists for other brands of web servers, but I have no idea if they support rewriting.

Page Rank

Which page is your primary index page, your front page? Does it start with "www."? What's displayed in your browser address bar when you simply type in your blog like "domain.com"? Does it automatically redirect to include the prefix? What if it includes "www." and you don't want it to? I ask these questions because your blog is ranked separately for "domain.com" and "www.domain.com". When someone links to your website, they could use either of them and they would resolve on your server and they would reach the front page of your blog. You want your page rank (especially on Google) to be consolidated to one landing page. I did this recently because I knew it was hurting my page rank. Here's how you can do it:

After "RewriteEngine On" in your .htaccess file (which should be in the root directory of your WordPress blog) and before any WordPress specific code (starting with "RewriteBase /"), insert this:

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]

Edit the first and second line and make sure you remove the "www." if you don't want to use it for your blog. The third and fourth lines ensure that your domain ends in a trailing "/".

If you're not using permalink rewrites for your blog, here's the whole thing:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
</IfModule>

Make sure you have this working before you continue with the next part in the series, which I plan to publish tomorrow.