As you know, I recently relaunched my website just over a week ago. Whenever you launch a new version of your website, one of the most important things to do is to create 301 redirects for your website. For me, I had a couple of issues after the face and I will explain how I fixed them, but first I’ll explain what 301 Redirect even are and why they are important.
What Is A 301 Redirect?
The easiest way to explain a 301 redirect is to compare it to a change of address form from the post office. When you move you want all of your mail transfered to you, so you fill one out. A redirect is the same thing. When you change the link sot some of your pages, the redirect is put in place to direct traffic to the correct page now that it has moved.
Why Is It Important to Redirect My Site Traffic?
There are two main reasons why it’s important, and the first one is rather obvious. If your site has pages that have moved, you obviously want people to easily be led to the same or similar content. This is really important if anyone has bookmarked any pages on your site.
The second reason is similar to the first, but it has to deal with SEO. Obviously, there’s a high potential that your pages may have built up some page rank from Google and the other search engines. When you launch a new site without redirecting your old pages that now have different urls, you are basically telling the search engines, “This page is dead and you can remove everything I’ve built up.” Obviously, this is a bad idea because you are now starting over when there is no need to.
Always Check To Make Sure Your Redirects Are Working
So you’ve now taken the time to redirect all of your old pages, but for some reason it’s not working. I ended up with this problem, but I didn’t notice it immediately. When I initially set up all of my redirects, I checked everything and it was all working, so I figured there wasn’t anything to worry about.
A couple days later, while I was closing down tabs in my browser (I normally have somewhere between 10-50 tabs open at a time), I came across the previous version of my website. I almost hit refresh, but decided to click on a link instead. When I did it, I was brought to a 404 page. Obviously, my redirects were not working.
I’ll now share my troubleshooting process with you. If you are having the same problem I had, then maybe this will help you.
What To Do If They Are Not Working?
The first place I checked was the actual .htaccess file where I keep my redirects. Everything looked good, but just to make sure my .htaccess file was really being read, I decided to put in some characters that would for sure take down my site. It worked. I knew the .htaccess file was being read and I’m sorry if you visited the site at that time!
MY next step was to look through the error logs on my server to see if anything irregular was coming up. I couldn’t find anything.
Next, I began to place in some new redirects to see what was working. I found that any redirect utilizing the /blog/ directory appeared to be broken. This led me to finally look at my site structure. Somehow, a new directory named blog was created and it had it’s own .htaccess file redirecting subdomain traffic.
My old blog was originally in a subdirectory. Just under two years ago, everything was in a blog.sethalling.com subdomain, but I lated switched it to a directory to build up the SEO of the sethalling.com domain.
As my new site is built entirely upon WordPress, I had no need for the directory, so I deleted it. But, when I launched the new site, I went into cPanel and updated the redirect of blog.sethalling.com, which recreated the directory and the new .htaccess file.
301 Redirect Troubleshooting Conclusion
The conclusion of all of this is to make sure you don’t have any other .htaccess files on your site if you are trying to create redirects from a parent directory. For me, I overlooked what cPanel would do, but luckily, I was able to discover the problem early on and get everything working.
Image Source: http://www.flickr.com/photos/sebastian_bergmann/1565541837/