I see all tinyurl like sites use 302

But what's the difference?Seems both are working for me

link|improve this question

12% accept rate
feedback

2 Answers

up vote 9 down vote accepted

A 301 (moved permanently) status means the resource has been permanently moved to a new location. The client (browser) should use the new location instead of the old one in future.

A 302 (found) status means the resource is temporarily located elsewhere. The client should use the given location for the current request, but in the future should continue to use the old location.

Both status codes will have the effect of having the browser follow a redirect. You should choose to use a 301 or 302 status depending on whether the redirect is permanent or temporary.

More information about these HTTP response codes can be found in RFC 2616.

link|improve this answer
What if I want to cancel 301?Is that out of control since it's not used again? – vps Feb 6 '10 at 16:53
@vps You can cancel the 301 redirect, but there is no guarantee the client will re-request the original URL. If you want to be able to cancel the redirect in the future, then you may be better of using a 302. – Phil Ross Feb 6 '10 at 17:04
feedback

They are different in SEO.

For 302 google will save the url of redirector and will point users to it.

Also (for tinyurl) using 302 make it possible to change redirection, e.g. in case of spam (see http://tinyurl.com/nospam.php?id=amgzs6 example). Using 301 makes harder to change the redirection

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.