Learn About 301 Redirects – Digital Marketing Madness

Today my guest is Rick Floyd, senior Web marketing strategist. We’ll be discussing 301 redirects. Welcome, Rick.





There are other error codes. 500 is a server error. There are 302s. I don’t want to go too deep into that, because that’s not what we’re talking about today.


Let’s say my website is mcdougallintervactive.com/seo, and I decide to make the URL of that page mcdougallinteractive.com/seotechniques; if I don’t tell Google and anyone else that’s coming to that page that it’s moved, they’re going to get a 404, it’s not found. If Google sees a 404, they’re going to remove that page from their index.
Maybe I’ve done a lot of work with SEO to get that page to be on the first page of Google search results for my targeted keywords. If that page is not found by Google, they may drop it, so we’re being friendly to the search engines by putting into place, a way of saying, “This page has moved permanently.” That’s really what a 301 redirect is.


A 301, you’re saying, “This page is never going to be at this address again,” and we want, not only when you visit the page will the browser read that code, the user wouldn’t even see it; you would just see the new URL. To Google, Google goes to that page, it’s not there, and it goes, “Oh, there’s a 301 redirect; this is the new URL.” It’ll read it. It’ll keep that page indexed. You won’t, hopefully, lose any SEO “juice” that you have with the page.

By doing the 301 redirect, you’re telling Google, “The new page is over here.” Like you said, that link juice that you’re getting to the old page will pass through that 301 redirect to that new page, and you should get, basically, the same amount of credit for those backlinks on that new page now, because you’ve set up that 301.

Like you said, not only might you have rankings for that page that you don’t want to lose for certain keyword searches, you might have incoming links. If you’ve done a really good job at SEO and you change the URL, the address of a page, and you don’t 301 redirect, you’re going to lose it all. They’re very important.




I’m also going to mention in a second, a little bit about WordPress, because WordPress is such a popular content management system across the Web. There are ways to handle it within WordPress that automatically write these files for you.
The more popular server is definitely the Unix and Apache servers. There’s a file that lives in the root of your website, right where your home page lives on your Web server, called .htaccess — very powerful little file, you can control a lot of things with it. Essentially, you put a line in .htaccess saying, “This URL 301 redirect to this URL.” It’s a little more involved than that. There are a lot of resources on the Web that you can look up to find out more about that…




Then on IIS, Windows servers, it’s all handled in something called the web.config file. Similar method. That file lives on your server. Google knows it’s there, browsers know it’s there, and check it to see if there are any directives, both from .htaccess and web.config. It’s basically saying, “Are there any directives in here I need to follow when I load this website?”



You mentioned WordPress. Do you want to talk a little bit about WordPress since that is a very popular content management system?





Regex is basically a series of symbols that – they include things like wildcards. If you’re familiar with filename wildcards, you can search for a file on your computer by saying — let’s say you know the file has the name “dog” in it. You can say, “Search for ‘dog.*” That’s telling the computer to find anything that’s “dog.anything”. Regex is sort of similar. It’s way too complicated to go into a full explanation of what it is.


Mywebsite.com/pdf, I’m going to change that to “documents” instead. Rather than redirect every single full URL to each PDF, I can say, with a regular expression, take anything that’s “PDF/anything” and change it to “documents/anything.”


So the regex looks like up arrow/pdf/.*, which means anything that begins expressly with PDF after the domain name, that’s the up arrow, includes the PDF folder, and includes anything after it — change all of those to documents, and then…


The reason it’s great is, it’s a regex testing tool. If I’m writing them, I can actually put them in and see what the output of my regex will be. I can look at it and try to figure out if this is correct. Am I writing the regex correctly? Am I getting the result I want? If you’re a beginner, it has links to all kinds of resources, help files, introductions, so it’s useful if you’re just starting out and if you know regex inside out and you just need a testing tool.


I want to test my 301 redirects. I know what my old URL, what my address of my page was; I’m going to put it into that tool and simply press “Check,” and it’s going to tell me what status code the browser’s seeing. If I didn’t do the redirect correctly, I might see a “200 OK,” meaning it found it where it was supposed to be. That’s not what I want.
If I did, what you’ll see underneath it is “301 Moved Permanently,” and then “200 Status OK.” It’s saying, “I went to this URL, I saw 301. It told me the page moved. Here’s where it moved to,” and that’s what you want to see.

Like you said, you’ll see the old URL, you’ll see that there was a 301 going to the new URL, and then you’ll see “‘200 OK.’ We’ve found the final page.”

Basically, I’m saying, “If you go to this URL, 301 redirect to this URL.” Someone else has put a redirect on that that redirects it back to the first page, and so your browser actually just starts going around and around. It’s redirecting, redirecting.




Let’s say you got a new website, you did a bunch of 301 redirects, and you want to monitor whether you did them all, whether you caught them all. Quite often if it’s a really huge website, it’s very hard to make sure you got them all.


You can start to see why it’s not being found, or you can simply say, “This page absolutely needs to redirect. I have this page in my new website, but it’s a different address. I guess I must not have redirected it. I need to apply a 301 redirect.









Leave a Comment!