We recently converted our blogging platform to WordPress. We did a custom template self-hosted version in order to have it match our primary website in basic design and look. At some point, we will move the entire website onto the WordPress platform but that's down the line and the subject of another blog.
We left the original blog online for a while as we moved some of the older posts onto WordPress. When we were done, we deleted the old blog files. All appeared well.
A few days later we were checking our domain in Google's Webmaster Tools and noted we were getting lots of 404 errors on the old blog posts. A 404 error tells the world that the "requested page was not found" on the server. Apparently we had developed back-links to the old blog site and Google had indexed many of our blog entries. We were a bit concerned about all the 404s impacting our ranking on Google and were desperately looking for an answer.
Disclaimer: the rest of this is technical in nature.
We're running an Apache Server and the answer was both easy and elegant. In the root directory of an Apache Server is a file named, ".htaccess" and this file can be a powerful tool. Our old blog was in the /blog subdirectory and the new blog was in the /wordpress subdirectory. We wanted any URL calling a file in the /blog subdirectory to be sent to /wordpress/index.php.
Should be redirected to:
We downloaded the existing .htaccess file to my PC, opened it in notepad, and added the following:
RewriteRule ^blog/.*$ /wordpress/ [R=301]
Basically, the code tells the server to take any requests for files in /blog/, redirect them to /wordpress/, and report it as a 301 (moved permanently) rather than a 404 (file not found)
We saved the file and uploaded it back to our server. Problem solved!
Tom Branch and Gina Branch, The Branch Team with RE/MAX Dallas Suburbs, service the greater North Dallas suburbs including Dallas, Plano, Allen, McKinney, Frisco, Lewisville, and Carrollton. While Gina concentrates on traditional listings and buyer/tenant representation, Tom specializes in assisting distressed homeowners to avoid foreclosure. Tom and Gina have published two books (Achieving Rock Star Status and The Field Guide to Short Sales) and are available for speaking engagements in the greater Dallas - Fort Worth Metroplex. Subscribe to The Branch Team Blog.
Copyright 2009-2013 - The Branch Team
The Branch Team - Texas Real Estate Broker 547597 | Team Members are Texas Licensed Real Estate Professionals
Tom Branch - National Mortgage Licensing System 341963
Important Notice: The Branch Team with RE/MAX Dallas Suburbs is not associated with the government, and our service is not approved by the government or your lender. Even if you accept this offer and use our service, your lender may not agree to change your loan. If you stop paying your mortgage, you could lose your home and damage your credit rating.
All information provided is deemed reliable but is not guaranteed and should be independently verified. Properties subject to prior sale or rental.