
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.
For example:
http://www.thebranchteam.com/blog/archives/2008/09/entry_114.html
Should be redirected to:
http://www.thebranchteam.com/wordpress/
We downloaded the existing .htaccess file to my PC, opened it in notepad, and added the following:
RewriteEngine On
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!
![]()
Originally posted at http://www.thebranchteam.com/wordpress/2010/11/28/we-modified-our-website-now-we-are-getting-404s/
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-2012 - 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.


You lost me with the Technical stuff, but as I am getting ready to do a WP Blog I suppose I should bookmark this page.
Tom ~ Thanks for posting this. Think I'll hop over to Webmaster tools and check everything is okay on my new website. The devil's in the details when you move websites, isn't it?
Gene #1,
I love the self-hosted WordPress platform! I wish I had found it years ago. It became a problem for me because I had an older self-hosted blog running on my server that I replaced with WordPress. If you're starting a new installation and never hosted your own blog this will not likely be an issue for you.
Tom
Denise #2,
"The devil's in the details when you move websites, isn't it?"
There's so much truth to that statement!
Tom
I had the same problem when I moved over to a self hosted wordpress blog. I had to hire someone to fix it for me -- WAY over my head. I had a feeling it was a "simple" fix but it was making my head spin and I just wanted my posts up again FAST. Glad you figured it out.
Tni #5,
I'm an old CoBOL programmer so while the language is different, I can usually pick up enough to handle things on my own. While it has cost me lots of time, I've saved lots of money and get it done the way I want it done...
Tom
I wish I were an old CoBOL programmer! I was having issues with bursts resulting in proxy errors. I switched from shared hosting to VPS and apache to lighttpd.
I tried to switch to nginx which seems to be the best option but there is too much shell configuration that needs to be done to make it compatible with PHP and putty scares me! I did this switch from apache to lighttpd yesterday and so far NO BURSTS and the loads are much quicker.
Luckily my host has a panel where I can do the redirects with some clicks of the mouse :)
I took a screen shot of my traffic. You can probably tell when I was trying to configure nginx (my site was down.) I threw apache back up (started getting bumpy and unstable) and when I installed lighttpd is when the stable line started!
Renee,
My original thought was hardware but it's interesting that it's stable using the new server software.
I host off-site with some domains on a well-run semi-private server in WI and the others hosted at GoDaddy.
Tom
Good Afternoon Tom
Thanks for the post. Have a great day.
I'm going back to flinging coffee cakes at people. You and Renee scare me.
Haven't started importing posts -- I've republished a few just so I have some content in place.
Tomorrow I hope to get my IDX from Diverse Solutions set up.
I may hire some one to move stuff and tweek. I really wanted to build it myself so I got a sense of how wp will run. I started with Headway and quickly realized I am not a designer. so I bought two themes from Studio Press. I started with the Agent Press Theme and decided it over emphasized search and listings -- I have bairdwaner.com for that! So then I bought the Corporate Theme. It's a little stuffy (like me) but I like the structure....just need to upload a custom header. I think I'll be able to move some of the code from one Theme into the other, but I worry a little about upgrades after that.....
I'm, still trying to figure out how to make the Parent-Child Theme work the best. What I really want is micro-sites on the wp base. I think I found out how to do it by making Landing Pages each named with a different community name. Then there will be general info, subdivision pages, community links, search and then of course the posts and market research. I couldn't have described what I wanted until I tried it myself, so I feel pretty good about it so far. I'm mostly ok with the html, but the css is tricky. I just don't know it.
Thanks for the call....I'll call Monday am to get your thoughts.
Leslie,
I have a listing appointment at 9 AM but will be back in the office by noon. It was easy enough to import content from AR. The hardest part is getting it all laid out. I picked up a plug-in for my authors this evening. I had to tweak the PHP to get it to look the way I wanted, but it works well now.
Tom
Just clicked on the new site -- looks great! Very nice transition from the other site. I like your videos -- the add a lot of ligth and spice.
Where are you writing first? I was told to write and publish on wp site and then republish on AR.
I also need to figure out my footer....with widgets.
I need a few more days!
I typically write on my WP first and later to AR. The exception is "members only" posting that go on AR alone.
www.branchteam.com is our main website. It was developed over the last couple of years and written in PHP.
www.branchteamblog.com is our WordPress blog. It was set up to have the same look and feel as our main website.
The two are on the same server and the WP blog is in a subdirectory on branchteam.com but they remain separate at this point. I may integrate the main website onto the WordPress platform down the line.
I'm waiting to see how the IDX works on your site.
There are so many really neat plugins to run. We're running: Better Author Bio (modifed to suit our needs), Fast Secure Contact Form, Google XML Sitemaps, List Authors Widget, ShareThis, SI CAPTCHA Anti-Spam, WordPress.com Stats, and WPtouch.
Talk to you tomorrow...
Tom
Thanks for the information! I've got a WordPress site running too.
What do you do when the warblshaft of the flux capacitor has a faulty finnigan pin? No easy fix there either, unless it's a month that ends in R.
=)
As with Gene, I have bookmarked this to
Bottom line. . if you don't know it . .hire it!
WordPress offers you a change from the static stagnant website that never changes
A WordPress platform offers you a living, breathing site that brings your visitors over and over again.
There is nothing better.
is great you were able to solve this so easily. We recently converted two websites over to Wordpress (the self hosted type). We really like it....
Tom: I believe the bursts are definitely an "apache" issue from what I have googled. My line has been "steady Eddie" with :knock on wood: no issues since I switched over late Saturday night.
Leslie: LMAO!
I have just moved my site and had a lot of pages that would now have different names. That 301 redirect is working like a dream. Not skipping a beat.
Remember the old days when you could just be a real estate agent and not a webmaster too?
Linda #21,
You can still do that, you just have to outsource the IT stuff!
Tom
Thanks for the good info Tom. I just started looking at WP a few weeks ago and your post has really good info on how you are integrating and transitioning. Thanks.
Tom, I was happy with just sort of understanding your post... Then when Renee had so much more input on the topic - it definitely lost me. Oh boy you guys, have I a lot more to learn (or pay for)!!
Tom, good information. This could have been a real headache. Thanks and bookmarked for future reference.
Tom: I am a little overwhelmed here also.. but still well worth saving ' in case!" Gay
HA! Anytime one is migrating information from one URL to another, no matter what the platform, REDIRECT is fundamental.
I thought I was starting to get a handle on all this tech stuff but obviously not.
Ok...now my head hurts. But I'm going to have a coffee nudge and go back and read this blog again.
Now don't I feel inadequate, thanks to you and Renee, well I was thinking of doing this myself but not now.
WOW! I have a tendency to immerse myself 'in over my head' activities and quests, but I just got a face full of just how 'in over my head' I really am when it comes to blogging and website operations. Don't get me wrong - I see this as some great information. I just don't understand all of it. But I'm encouraged by the support of fellow ActiveRainers and the knowledge that I can call on many of them for help when I hit a stumbling block. How/where did you come up with the coding for the permanent move?
Thanks, Tom, for the Post, and the rest of you for the contributions, particularly Renee & Leslie.
~ \ | / ~
"Remember -- Think twice, push ‘Send' once. Blogging, posting, commenting: It's all 'never having to say you're sorry', because that won't make any difference --
-- it's FOREVER!"
Tom, very interesting, I have been thinking of doing the same thing, maybe I should re think this or really plan ahead!
Ty
Thanks, guys. Now i'm scared to the point of almost having anxiety issues! I bought my domain name and 3 years of hosting a couple days ago, and tonight I was going to try to start figuring this whole WordPress thing out. Now, it's like someone sucked the oxygen outta here. I think (thought?) I was kinda smart, at least enough to figure things out, but now I'm not sure.
Is there a book I should read first?
Eric,
If you're just getting started you'll be fine. It's converting sites that causes 404 issues.
Tom
David #32 - Don't worry about the initial set-up. I'm a huge fan of WordPress. It's realtively easy to get up and runing wtih some basic knowledge of server and PHP.
Lenn #29 - We done redirects in the past as the file level using PHP, I never thought about having to redirect and entire directory though.
Renee #19 - Glad that's working for you now. Leslie's always fun to read!
Tom
Nice explanation of the 301 redirect, Tom. Are you sure the Cowboys didn't have anything to do with the 404s?
Tom - A very simple elegant solution for your problem. Fortunately, you only needed to use a simple regular expression in your rewrite rule as you kept your file and directory structure the same.