Most SEO's are taught the simple mantra that a 302 (temporary redirect) is bad, and a 301 (permanent redirect) is good.
This is wrong. Or at least, part of it is.
An SEO quoting the above to someone who is really knowledgeable in web servers will have just shot themselves in the virtual foot, and probably made their job harder, since now the server expert is more likely to dismiss other things they are saying as possibly oversimplified and misleading, too.
The good news is that a 301 is usually what you want as an SEO, and you want to avoid 302's, so even though you may have been wrong in your ideas as to how things work, the net effect was probably correct, or at least, good enough.
As with many things that are "good enough, it works", most people never bother to look further. The rest of this article is for those who actually prefer to understand things, rather than those who just follow checklists blindly. The rest of you can stop here and be happy that 301's normally do the job you think they are doing.
A 302 actually isn't a Temporary Redirect
A 307 is. In reality, a 302 just means "Object Moved", or "Found", which, if accompanied by a target URL, browsers and servers interpret as a redirect. But with no target URL, they will happily stay there, and it's not an error.
In reality, a 303 is what most SEO's think a 302 is. A 303 means "See Other". A 307 is the actual Temporary Redirect. It really means temporary, as in the very next request should also be made to the old URL, and the new one should not even be cached. This is usually only used for emergency redirects (like when a primary server is down) and the like.
A302 doesn't dictate a redirect, it just says that what you were looking for moved, and it's been found there. You are usually redirected only as a courtesy and for usability purposes. Technically, you should use a 303, which really does the job properly.
The Problem With 301's
A pure 301 actually isn't always the best choice for a redirect, either. The problem is that a 301 is cachable, and therefore if you ever change that 301 to point to a second place, it may take quite a bit of time for the search engine to update it's files, which is why there is often a delay in you seeing results after changing 301's.
For example, let's say you 301 me.com to you.com. Then later you decide you want to change the me.com redirect to us.com. There can be a significant delay in this working, because the search engines will cache the original redirect for quite some time.
Want to fix this?
You can put a 301 on you.com as well as me.com, which will create a second hop in some cases, but will give you some time for the caches to be updated and speed up indexing, in some cases dramatically.
It's a simple fix, but it can save you a lot of time and headaches.
Want another fix? (Best Practice)
When you create 301 redirect, prevent it from being cached is there is a possibility that you will change it in the future.
If you don't think you'll be changing it, then just do what you usually do - it will cache automatically, which is normally a good thing.
If you might change it, or expect to change it, you can disable the cache in one of 2 ways in either the server response or the redirect page. Server response is better, IMO.
- (BEST) use HTTP headers in the server response to send "Cache-Control: no-cache"
- Or, if you can't do that on your server, you can use "
Pragma: no-cache"option in your html redirect page header area. But real server headers are better than the pragma.
- 300 Multiple Choices –
- 301 Moved Permanently –
- 302 Found –
- 303 See Other –
- 304 Not Modified –
- 305 Use Proxy –
- 307 Temporary Redirect –