4

Is it possible to 301 redirect a page and then reuse the redirected URL again in the future? What are the disadvantages of using the old link?

For example:

www.example.com/contact 301 redirect to www.example.com/contact-us

And in the future I would like to reuse www.example.com/contact again.

1

4 Answers 4

13

The problem with reusing a 301-URL is that some browsers will cache the redirect for a very long time, see, for example:

So, theoretically, there could be users that are automatically redirected from contact to contact-us, even though you have disabled the redirection ages ago.

If that is not acceptable, you cannot re-use the "301-tainted" URL. Thus, the general advice is not to use 301 redirects unless the redirection is truly "permanent".

1
  • According to this discussion, browsers will invalidate a cached 301 redirect if they detect a redirect loop. If that is the case, then there is really no issue with changing redirects back to the way they were before. The article you posted is from 2010, so it is possible that this 301 loop cache invalidation is a new browser feature. Commented Nov 7, 2018 at 22:01
5

As long as you remove the 301 redirect link that you create between www.example.com/contact to www.example.com/contact-us, you should be fine.

If /contact has a lot of 'seo juice', it is advised to try to keep the 301 redirect in place for a few months before removing it. Once you remove the 301 redirect, feel free to re-add /contact back into your sitemap and have Google re-index the page.

Just note that if you have both /contact and /contact-us pages with similar content, Google may penalize both pages for duplicate content.

Update


Multiple people bring up a good point regarding browser caching of 301 redirects. If you plan on using the /contact-us page for a short period of time, before you want all of your SEO and customer traffic to return to /contact it might be better to use a 307 redirect instead of a 301 redirect.

More information about 307 redirects can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307

5
  • complete explanation. this is what I looking for. thank you.
    – Scramble
    Commented Nov 7, 2018 at 3:51
  • Unless I'm misunderstanding something, won't all your visitors still have the /contact => /contact-us 301 cached, with no obvious way for a common user to resolve this? Whether google reindexes it or not isn't going to help existing visitors.
    – Phoshi
    Commented Nov 7, 2018 at 9:43
  • @Phoshi, It is a good point and I updated my answer based on that. The question seemed more SEO related and I was just answering directly based on that. I did not try to answer for addressing post-migration traffic flows. Thanks for the reminder, for other audiences.
    – devnull
    Commented Nov 7, 2018 at 11:43
  • @Phoshi Modern browsers will invalidate that cached redirect as long as there is a redirect from /contact-us to /contact. Commented Nov 7, 2018 at 22:09
  • @MaximillianLaumeister If you want to transition all the traffic back this works, sure.
    – Phoshi
    Commented Nov 8, 2018 at 9:43
2

There is no problem with switching the 301 redirection to go the other way, even if users have it in their browser cache. It will not cause any redirect loop issue because modern browsers invalidate a cached 301 redirect as soon as they they encounter a redirect cycle. Thus there is no disadvantage beyond the possible slight hit of the 301 itself, and your old URL will not be "tainted" in any way.

If you decide to switch it back, just make your 301 point the other direction, from contact-us to contact.

See the discussion here for details on browser redirect caching behavior in the presence of a cyclical redirect.

5
  • thank you for the explanation. it's very useful information.
    – Scramble
    Commented Nov 7, 2018 at 3:52
  • Some browsers cache 301s forever, so your advice will potentially result in an infinite redirect loop in some cases.
    – ceejayoz
    Commented Nov 7, 2018 at 16:50
  • @cee Is there no mechanism that tries to detect whether maybe the local cache is stale?
    – JFBM
    Commented Nov 7, 2018 at 16:53
  • @J_F_B_M There's no requirement for such a mechanism in the spec, to my knowledge. As such, I wouldn't rely on specific browser implementations of a cache clear. 301s are supposed to be permanent, and should be treated as such.
    – ceejayoz
    Commented Nov 7, 2018 at 16:54
  • @ceejayoz Not true, at least this discussion leads me to believe that it is not. Browsers are smart enough not to get caught in a redirect loop caused by a cached redirect. Commented Nov 7, 2018 at 21:56
1

You can reuse URLs that were previously 301 redirected, but only if the 301 was configured with directives to limit caching.

As others have noted, some browsers will cache the 301 response without an expiration date, and without revalidating to check if it has changed, but only in the absence of explicit cache directives.

For this reason, the best practice is to always set cache directive headers for every 301. These headers are often used to forbid caching entirely:

Cache-Control: no-store, no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:01 GMT

Assuming only HTTP/1.1 and modern browsers, I believe this minimal header achieves the same thing:

Cache-Control: no-store

It may be safe to use a more permissive Cache-Control header in order to allow reasonable temporary caching.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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