• Sign Up for Newsletter - Click Here
  • Join Me on Facebook
  • Follow Me on Twitter
  • Connect with Me on LinkedIn
  • Subscribe to My SEO Feeds

Redirecting index.html After a WordPress Migration

Aug 23rd 2010 // by Steve // SEO Best Practices

There are literally thousands of search results in Google for how to do a 301 redirect, but the ones that show you specifically how to redirect index.html after migrating to WordPress are buried and difficult to find among all the other 301 tutorials.

Being the SEO geek that I am, I had to create this page for no other reason than have a way for myself to access the code quickly in the future.

The Problem

When you migrate a static HTML website to WordPress, in many cases the static website included a file called index.htm or index.html. If this page is indexed in the search results, it will produce a 404 error after you upgrade to a platform like WordPress.

As a Webmaster, you might think that simply adding this code to .htaccess would fix the problem:

RedirectPermanent /index.html http://www.yournewwebsite.com/index.php

You’ll find doing this creates an endless loop and breaks your website. The other pages will redirect to their new pages just fine, but the index page remains a real pain.

The Solution

Pop the following line of code into your .htaccess and problem solved:


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://www.example.com/$1 [R=301,L]

Why Bother Redirecting?

Consider the possibly hundreds or thousands of links you might have pointing to index.html. Google’s PageRank™ algorithm is structured mainly around popularity (links, mentions, CTR and overall visibility). If Google’s determination of where to rank your website is dependent on your website’s popularity, why send all of those potential links to a 404 error page? Think about it. Redirection saves your PageRank™ and could save your ranking in the search results.

Thanks for reading.

  • Limited Time Offer!

    For a limited time I'm offering SEO Consulting Services to help fund a few big projects I have in the works, and to pay those darn publishing fees when I release my next book on SEO Strategy.
  • Free SEO Guide

    Download the guide I should have given to every client who ignored my request for keyword-themed content.

    Free eBook: SEO Content Writing Guidelines

    Be one step ahead of your competition with this SEO Content Writing Guide. This guide introduces tools and best practices, such as using online collaboration software and keyword tools to stay organized with your SEO campaign.

  • SEO Question?

  • Proud Member of:

    Proud Member of SEMPO
  • SEO Jedi Guardian

    SEO Wars: Jedi Guardian - Blue Lightsaber Badge
  • Apply for a Military Loan Online at JustMilitaryLoans.com

2012 © Creative SEO Strategy. This is Steve Wiideman's official SEO Blog. Links and mentions are appreciated. Privacy Policy | Site Map

http://www.seosteve.com
http://www.seosteve.com/wp-content/themes/hashone