Finding A New Home For Your WordPress Blog

WordPress

If your like me, you sometimes get lazy and take the path of least resistance which bites you in the ass a few days later.

This happened to me while setting up this site which is driven exclusively by WordPress.

My initial research indicated you could either use the install wizard found on my hosting provider or attempt the slightly more laborious step-by-step manual install via FTP, mySQL and PHPAdmin.

You guessed it, I went for the second option and it was a snap. I am used to things going wrong while setting up websites (that comes with the territory) so I was pleasantly surprised by how smooth and quick the wizard install proceeded. Within minutes my WordPress site was up and running.

This was yet another sign that I had been ignoring open source for too long. I have been a fan of PHP and mySQL for a while but I nevertheless toed the Microsoft line and stuck with what I knew: SQL Server, Aspx, Visio etc.

My recent conversion to an Apple Macbook Pro (From a Dell Vista OS) and a Linux box at home are concrete steps I am taking to redefine how I do things with regards web development.

WordPress is another step in this new direction.

Anyway, back to my results. So, yes the wizard install was a breeze but I immediately realized after playing around with the default configuration that I had made my first strategic blunder: My URL was was defaulting to http://www.jason-stevens.com//wordpress which was great for the guys at WordPress, since any google indexing will help market the phrase ‘WordPress’ via the sub-directory on search engine results. But, it limits the optimization ‘reach’ of my site.

No offense, I really don’t mind giving them a free plug, it’s just that they should not benefit from my laziness.

Of course, I could argue they should default any WordPress install to www.mydomain.com/blog but since it’s free product I guess you can’t really blame them for this wee bit of directory branding!

The second issue I had with the URL www.jason-stevens.com/wordpress is that it just does not look that great. It’s long-winded and adds nothing helpful to the URL for the web visitor.

Since WordPress will be the publishing engine for the entire site, I don’t really need to highlight a ‘blog’ directory. When the user types in www.jason-stevens.com I just want it to default to the home page of my blog. It just looks more professional and less ‘granular’.

SOLUTIONS

So, after a bit more research on Google and the WordPress codex (documentation) I quickly saw a couple of solutions:

  1. Move all the WordPress files to the root directory and do a few configuration changes to mySQL and the WordPress admin settings. This includes fixing any permalinks that I may have enabled or updating current image paths including your default logo on the site.
  2. Uninstall my WordPress blog and start over attempting a step-by-step install.
  3. Manipulate the Apache hypertext (.htaccess) file and use a mod rewrite to create a permanent 301 redirect to the root of my domain name. Oddly, this does not appear to be well-documented route on the web, probably because it is considered a workaround for duplicate content and not specific to my particular goal. However, I have used this approach successfully on another site I set up, Catamaran.co.za. I am not saying it’s the right approach, but it did work.

Which option did I choose? Well since I am lazy I initially went for (C) and then ended up doing (B).

I think you can see how laziness actually ends up giving you more work in the end — it’s the law of the Internet jungle!

A bit more planning and patience on my part would have sped up this entire process but mistakes are a great learning tool, too.

Let’s review option (C). [NOTE: I must apologize in advance, but I cannot offer you any ‘support’ on the solutions below. I offer them in good faith but I am by no means an expert on URL rewrites and .htaccess files. I put this together with the help of one of my hosting provider engineers after reading this excellent article by Matt Cuts relating to canonical URLS and the implications for SEO.]

Here is what the code in the .htaccess file looks like. It’s basically redirecting from the sub-directory to the root with two key inflection points: It’s using a 301 redirect to minimize disruption to search engine rankings; it’s forcing Google to recognize www.mydomain.com as the front door not http://mydomain.com.

#Options +FollowSymlinks
#RewriteEngine on
#rewritecond %{http_host} ^mysite.com [nc]
#rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc]

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ [NC]
RewriteCond %{REQUEST_URI} !^/wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wordpress/$1 [L]
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ [NC]
RewriteRule ^(/)?$ wordpress/index.php [L]

If you simply wish Google to recognize your default domain as http://www.mydomain.com rather than http://mydomain.com then use this basic script in the hypertext file:

Basic URL rewrite
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.\mydomain\.com
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]

Just be careful with the above. Like javascript the Apache hypertext file is sensitive — one period, dot or slash out of place and your site will crash.

For an excellent indepth article and discussion on .htaccess files, read this article: SEOmozBlog Canonical URL Tag – The Most Important Advancement in SEO Practices Since Sitemaps

In the end, I decided that I was still uncomfortable with the above. No matter what anyone tells you I have experienced drops in rankings when using 301 redirects or manipulating URLS. One historical reason may have been because my destination URL content did not match exactly the referring directory content. There is an ‘unknown’ margin of error.

In any case, 301 redirects are not a perfect science. They definitely minimize disruption to your rankings but who knows how the spark plugs at Google program their algorithms these days.

After a sleepless night considering the implications of the .htacess file, I decided I better move the files to the root as described in (2) above.

Since my blog was only a few days old, it would have been no great shake to delete and start over, but I wanted to push myself a bit and see how flexible and user-friendly WordPress actually is.

I reviewed a couple of useful articles on the web but eventually decided to stick with the codex documentation provided by WordPress. It seemed pretty clear cut.

I will not go through all the steps as they are pretty self explanatory. I will just add a few other basic points to their step-by-step walkthrough, which although obvious, are worth highlighting:

  • Ensure you have backed up your wordpress database via PHPAdmin. This is relatively straightforward. You can review this help file in the WordPress codex.
  • I would also take the second step of exporting your ‘data’ file via the Tools | Export menu in WordPress prior to attempting the migration.

MY RESULTS

It was a walk in the park. It literally took less than 10 minutes. The only additional issues I encountered were re-attaching my site logo. Also for some reason my widgets were removed from my side panels. But after a few drag and drops, my original widgets were back in place and working.

Thus, if your feeling slightly intimidated by the prospect of moving your blog to another directory on your site, don’t be: The process is pretty well documented and the software flexible enough to make this relatively painless.

Here are a few additional background links to get you up to speed…hope this helps.

REFERENCES

WORDPRESS CODEX
WordPress: Moving WordPress

WordPress: Backing up WordPress: Backing_Up_Your_Database

WordPress: Permalinks

URL REWRITES
SEOMoz: URL Rewrites and 301 Redirects – How Does It All Work?

URL CANONICALIZATION ADVICE
Matt Cuts:SEO advice: url canonicalization

SEOmozBlog Canonical URL Tag – The Most Important Advancement in SEO Practices Since Sitemaps

3 Responses to “Finding A New Home For Your WordPress Blog”
  1. Eldon Kalkman 25 June 2010 at 12:44 am #

    I loved your article post.Really looking forward to read more. Cool.

  2. San Diego event photographer 27 June 2010 at 8:14 am #

    Great post. I am just starting my blog as well. Do you find it hard to have something to say, because I don’t feel like natural writer and it seems to come natural for you.

  3. admin 27 June 2010 at 7:08 pm #

    Thanks — yes, it’s always hard to express yourself to an audience. But, in many ways I am writing this blog for myself to help me internalize, systematize and express my thoughts. Once you have that perspective it gives you the mental freedom to ‘say something’.

    By the way, I took at your look at your site and see your past experience in computer mapping?

    http://www.pacificphotopro.com/WiredInSanDiego.pdf

    This is awesome stuff! You should be sucking all that information out into daily posts….

    If you could combine google geo mapping apps with your photo skills your blog would become a big hit. I can already see your a very experienced writer so I appreciate your comments — I may need to take some lessons form you đŸ™‚

Leave a Reply