I'm currently in the process of re-authoring and re-building the Beginner's Guide to Search Engine Optimization, section by section. You can read more about this project here.
Redirecting Pages for Users & Search Engines
On the web, as in life, the only constant rule is that nothing is constant and all things must change. However, on the web, when things need to change, or, in our case, move, specifically from one URL to another, there are critical best practices to observe.
Let's first assume that you have a simple scenario - a URL that needs to re-point to another address permanently.
There are multiple options for accomplishing this feat, but in general, a single one, the 301-redirect, is preferable for both users and search engines. Serving a 301 indicates to both browsers and bots that the page has moved permanently. Search engines interpret this to mean that not only has the page changed location, but that the content, or an updated version of it, can be found at the new URL. The engines will carry any link weighting from the original page to the new URL, as below:
Be aware that when moving a page from one URL to another, the search engines will take some time to discover the 301, recognize it, and credit the new page with the rankings and weight of its predecessor. This process can be lengthier if your page hasn't changed in a long time and the spiders rarely visit it, or if the new URL doesn't properly resolve.
Other options for redirection, like 302s (temporary redirects), meta refreshes, or Javascript are poor substitutes, as they generally will not pass the rankings and search engine value like the 301.
Transferring content becomes more complex when an entire site changes its domain or when content moves from one domain to another. Due to abuse by spammers and suspicion by the search engines, 301s between domains sometimes require more time to be properly spidered and counted. For more on moving sites, see Expectations and Best Practices for Moving to or Launching a New Domain.
Server & Hosting Issues
There are, thankfully, few server or web hosting dilemmas that affect the practice of search engine optimization. However, when overlooked, they can spiral into massive problems, and so are worthy of our review. The following are server and hosting issues that can negatively impact search engine rankings:
- Server Timeouts - If a search engine makes a page request that isn't served within the bot's time limit (or that produces a server timeout response), your pages may not make it into the index at all, and will almost certainly rank very poorly (as no indexable text content has been found).
- Slow Response Times - Although this is not as damaging as server timeouts, above, it still presents a potential issue. Not only will crawlers be less likely to wait for your pages to load, but surfers and potential linkers may choose to visit and link to other resources because accessing your site becomes a problem.
- Shared IP Addresses - Lisa Barone wrote an excellent post on the topic of shared IP addresses back in March of 2007. Basic concerns include speed, the potential for having spammy or untrusted neighbors sharing your IP address, and potential concerns about receiving the full benefit of links to your IP address (discussed in more detail here).
- Blocked IP Addresses - As search engines crawl the web, they frequently find entire blocks of IP addresses filled with nothing but egregious web spam. Rather than blocking each individual site, engines do occasionally take the added measure of blocking an IP address or even an IP range. If you're concerned, search for your IP address at MSN/Live using the IP:address query (or SEOmoz's Who Else is Hosted on My IP Tool).
- Bot Detection and Handling - Some SysAdmins will go a bit overboard with protection and will restrict access to files to any single visitor making over a certain number of requests in a given time frame. This can be disastrous for search engine traffic, as it will constantly limit the crawling ability of the spiders.
- Bandwidth & Transfer Limitations - Many servers have set limitations on the amount of traffic that can run through to the site. This can be potentially disastrous when content on your site becomes very popular and your host shuts off access. Not only are potential linkers prevented from seeing (and thus, linking to) your work, but search engines are also cut off from spidering.
- Server Geography - This isn't necessarily a problem, but it is good to be aware that search engines do use the location of the web server when determining where a site's content is relevant to from a local search perspective. Since local search is a major part of many sites' campaigns and it is estimated that close to 40% of all queries have some local search intent, it's very wise to host in the country (it's not necessary to get more granular) where your content is most relevant.
I'm actually really excited to have this section finished, as it means I can start diving into some less dry, more fun material with the next few chapters :)
BTW - If you haven't yet taken our survey, please do! And yes, expect to see me post this at the bottom of every blog post for the next few days to help encourage participation. We're hoping to get 3,000 or more responses, which would dwarf the sample size of something like the SEMPO report (which garnered 587 responses for 2006).
is there going to be another, more detailed chapter about redirects?
i think redirects deserve an entire chapter, not just several paragraphs. i think it's a confusing topic for some people and can be easily messed up. rand, with your simple, direct writing style i think you could help people out a little more here.
otherwise...great stuff as usual.
Kimber - I agree. I'll try to build out that section a bit more. I'm just worried that a lot of redirect stuff might be more "advanced" than a "beginner's guide" dictates, but I'm probably just making excuses because I was tired... :)
The form for the 301 that i'm using is:
RedirectMatch permanent ^/the-page-you-want-to-redirect.htm$ https://highest-level-url.com/the-page-you-want-to-
redirect-TO.htm
Any comments?
Yes. You have much more flexibility by using RewriteCond and RewriteRule
You also get to control the order that the redirects and rewrites are parsed.
You lose that ability if you start using directives from different Apache modules.
Seconded
Dear 301 redirect
Without you, my SEO skills would be far from complete, and I would be very unhappy.
Lots of love
richardbaxterseo
Rand, any advice on multiple/historic 301's?
Certain sections of one of the sites I manage have been 301'ed a few times during its lifetime and I always try to ensure all previous redirects are updated to point at the most recent URL.
Would you concur that avoiding multiple redirect 'bounces' is best practice for SEO? I always get an earful from webmasters tasked with redirecting URLs and they always ask me to justify the sometimes lengthy work required.
Always avoid a redirection chain.
Get from A to Z in one step.
Get from B to Z in one step.
Get from C to Z in one step.
Avoid A --> B --> C --> ... --> Z.
I often see this: domain.com/index --> www.domain.com/index --> www.domain.com/
or the alternative: domain.com/index --> domain.com/ --> www.domain.com/
on many sites and that is not a good idea.
Now why didn't I think to illustrate it quite so concisely!?
Thanks for the ABC without the ZZZ 'g1smd'
A good point well made and as you say, its something I also see overlooked all too often.
I actually really want to add that piece of advice into the guide, so I'm going to try to edit today. Thanks for the reminder!
An example of "How To" "301 redirect" would be an great addition.
I thought it would be important to note that country specific searches through google.ca (for Canada) for example, do look at either the domain extension or the location of the server when giving local relevancy within the search results.
Thanks Rand, keep up the good work.
I feel I have major flaws on technical SEO knowledge, can you guys recommend any readings I should do to start getting in shape on anything related to:
Optimizing PHP, optimizing ASP, SEO and hostings? etc. Is there any SEO book or resource that you would recommend reading and that covers all this techincal stuff related to SEO?
Thank you I would appreciate any help.
There's several tens of thousands of posts at places like WebmasterWorld that have examples covering just about anything people might want to do.
"Be aware that when moving a page from one URL to another, the search engines will take some time to discover the 301, recognize it, and credit the new page with the rankings and weight of its predecessor."
Ok, i have done a redirect from blog/date/postname to blog/postname
RedirectMatch 301 /blog/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ https://www.domain/blog/$4
Google, found new urls and cached and indexed them. However, my ranking is dreadful for title of post, searches.
Its only been a couple of weeks since implementing this redirect, and only a week since google cached and indexed. They visitrs quite often.
So its the last sentence of above am wondering about, how long to get the credit i had before, approx?
Thanks
I just spent an hour reading maybe half the diffrent links to re-directs, etc. Very informative learning guide SEO MOZ people!
Feedthebot: I bookmarked your https://www.feedthebot.com/redirects.html page.
Awesome information for someome new to SEO,
Thanks, now I just need a tutor!!! LOL!!!
Randfish, thanks from all us new to SEO, this is very helpful!
I'm curious on any direction on the best way to do multiple single page redirects. I'm going to be going through my site by hand and creating 301 reidrects, but it's not something I can write a rule for. Is there a significant decrease in speed as say 50 redirects are added to a .htaccess file?
Is there any way to roll back a cached 301 redirect. Is this possible? (A --> B --> A)
I have to say, I've lost more sleep over bad web hosting than any other thing in over 10 years of managing web and internet marketing projects.
Small hosting companies start offering excellent service, then grow big, get bought out and decline. Big hosting companies offer good deals, but with lousy service, and a very restrictive features set. Simple things like redirects via htaccess are often not possible, and log file access or good server stats are absent.
For this reason, I set up Search Engine Friendly Web Hosting which does what it says on the tin. The idea was to provide a hosting service brimming with features for the expert and beginner, so along with all the bells and whistles, there is the ability to do one click installs of WordPress, Joomla, OsCommerce etc. It uses the resources of a big host, but modified to provide what the informed internet marketing expert needs.
If you'd like a free test drive, please get in touch, and banish hosting related stress!
Jeremy.
I have to say, I've lost more sleep over bad web hosting than any other thing in over 10 years of managing web and internet marketing projects. Small hosting companies start offering excellent service, then grow big, get bought out and decline. Big hosting companies offer good deals, but with lousy service, and a very restrictive features set. Simple things like redirects via htaccess are often not possible, and log file access or good server stats are absent. For this reason, I set up https://www.searchenginefriendlyhosting.com/ which does what it says on the tin. The idea was to provide a hosting service brimming with features for the expert and beginner, so along with all the bells and whistles, there is the ability to do one click installs of WordPress, Joomla, OsCommerce etc. It uses the resources of a big host, but modified to provide what the informed internet marketing expert needs. If you'd like a free test drive, please get in touch, and banish hosting related stress! Jeremy.
Thanks for the informations about 301.
i like it.........
Great work as always Rand. Looking forward for the complete guide.
If I could make a suggestion, I thinkg it would be even greater if you wrote a complete guide for both beginners and advanced SEOs.
Cheers
In the footer of the post in the RSS feed, there is not a link to the survey you are reminding /asking people to fill in. Are you expecting us to google for it? Suggestion: add a link to the survey when you remind people to do the survey.
Thanks for the actual examples of 301s - I've never used them and I know that has been costing me SERPs.
I think it's great you're rewriting the guide as a whole. Please keep up the good work. :)
I appreciated the link to Expectations and Best Practices for Moving to or Launching a New Domain the most as I'll be involved in tackling a move in the near future.
I'm still waiting for your autographed picture to drop into my mailbox. ;-)
Can you recommend a resource that details how to properly write/implement 301 redirects? I have had success using them on Windows servers, but when I have tried using them in the .htaccess file on Linux platforms it never seems to work.
take a look at this page. I have used it, and it was clear enough for me for the htaccess redirect codes :
https://www.ilovejackdaniels.com/cheat-sheets/mod_rewrite-cheat-sheet/
Joel, some great examples are...
Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^newSite.com [nc] rewriterule ^(.*)$ https://www.newSite.com/$1 [r=301,nc]
rewritecond %{http_host} ^oldSite.com [nc] rewriterule ^(.*)$ https://www.newSite.com/$1 [r=301,nc]
rewritecond %{http_host} ^www.oldSite.com [nc] rewriterule ^(.*)$ https://www.newSite.com/$1 [r=301,nc]
rewritecond %{http_host} ^oldSite.com/ [nc] rewriterule ^(.*)$ https://www.newSite.com/$1 [r=301,nc]
rewritecond %{http_host} ^www.oldSite.com/ [nc] rewriterule ^(.*)$ https://www.newSite.com/$1 [r=301,nc]
But there are so many situations, that it always takes some experimentation.
Go to my redirects page on feedthebot where I explain redirects in a very simple manner.
That's n good article on 301 Redirect Buddy
Hey Joel,
I actually find Linux 301's to be much easier to do quickly on a site-wide basis; here are a couple of articles I usually refer to. They're pretty complete:
One thing to remember is that you need to put something about 'RewriteEngine ON' before any of your redirecting code, and that different servers sometimes require different syntax, i.e. one might use RedirectPermanent another might use RedirectMatch, etc. So you may have to try a couple of times with one file before redirecting a whole bunch.
Anyway, the two sites are here and here.
Patrick and David both - good responses and excellent resources. Thanks. I've been strugggling a bit with this very issue.
m having a hard time with the redirect thing but reading this article somehow gave light on me..
Hi everybody!
Long time reader, first time commenter :)
I have an issue with a site where the www and non-www versions of the domain currently exist as 2 separate sites. Each time a new www page is created, it is automatically duplicated in the non-www version.
What's the best way to resolve this? My original thinking was to 301-redirect the entire non-www site to the www site, and create a rule that does this automatically in the future. However, you mentioned that this could look spammy (301 redirects from one domain to another). Is there another way?
Hi Erin, welcome.
Actually what you are describing as your original thinking is how it is typically done. See the comments above for how to actually do it.
Rand was talking about moving content from old-domain.com to new-domain.com which needs to be done with care (Dr. Pete wrote an excellent post about doing this in YouMoz). What you are talking about is 'moving' content from current-site.com to www.current-site.com which is sub-domain and not another domain. No problem there and actually highly recommended to do.
Thanks so much! Good to know I'm on the right track :)
What you need is "domain canonicalisation" and there are no issues with using redirects for that.
Get that code set up as soon as possible.
Server Geography
This concerns me a little. I host in the US as the hosting is a lot cheaper than NZ. Does a country specific domain name negate the server geography? For example my domain name is devour.co.nz but is hosted in the US. Hopefully .co.nz tells the search engines that it is based in NZ.
Hi Glen, the ideal would be localized domain AND localized hosting as the search engines still take hosting location into account, but it's an issue that can be overcome, and one that I feel search engines are trying to get smarter about with the economics of hosting causing such a common scenario. Anyways, to get a boost in your localized NZ searches, try to acquire as many incoming, applicable .co.nz links as possible, place a business address on your website footer (if possible), and register in any and all local directories. E-Commerce Optimization put out a nice local directory guide here.
We host in the US as well and even regularly use .com domain names because the service and DNS here (Netherlands Antilles .an) is unreliable. And I'm being positive here...
This means that we really need to focus on local marketing to get our sites ranked in local search. We do this by acquiring links in local sites and mentioning the applicable island a lot in the pages (as Chuck says). If possible we also try to use a local name in the url (i.e. blablacuracao.com). It does seem to work and is a lot easier than overcoming the local challenges. So, I guess it should concern you only a little and not a lot.
I also heard recently that it's good for SEO to use the <address> tag but I always thought that one was deprecated. Anybody have any ideas on that?
By the way, I have taken the survey already but I had to try it 2 times because the first time it became an infinite loop or something... It only said something similar to "recording question... be patient" but I was patient during approximately 6 minutes.
Hi omarinho
I got caught in that same loop and just gave up on the survey. Sounds like I should give it one more go, eh?
Thanks for the updates, I look forward to the finished project. I have an Internet Marketing guide that I have offered that is pretty much outdated as well (2006). I debated on whether or not to publish it in print, and then I just figured it would be outdated too quickly. I recall speaking to someone new to SEO who showed me a (print) book that was about 4 years old that he was using (yikes).
Thanks for motivating me to get back to it and keep it free :)
I recently had an issue with a client that couldn't do 301 redirects because of the cache system they had in place to handle their traffic queries (they have a huge server load and not enough resources to handle the traffic without cacheing). That was a unique issue I found very interesting.
I am always amazed at the various IT guys' reactions to switching their lame 302 redirects to the much more friendly 301 redirects favored by SEO professionals. You would have thought I had asked them to walk to across the country on foot. That really is the biggest hurdle I find in relation to redirects for enterprise level clients: Convincing the IT Team that it's worth their time to do it and that it really isn't that hard..lol.