How long does it take for a removed redirect to disappear?

I’ve noticed a couple times that after removing a redirect from my _redirects file and deploying, the redirect rule keeps working for a while after. Is there something I can do to force the deleted redirect to stop immediately?

hi there,

i can’t find the thread at the moment, but i do believe that simply removing the redirect from the file isn’t sufficient to “clear” it. Unless i am mistaken, you need to set a new redirect to “Replace” the one you are removing to the new desired location.

Thanks @perry!

When you say “replace”, what do you mean exactly?

The redirect that I deleted was this:

/coaching / 301!

(i.e., redirect requests for the coaching page to the home page)

What would I replace that with to stop redirecting /coaching to /?

TIA!

Removing a redirect will remove it from OUR service as soon as the deploy is published at your production URL. It will not remove it from browsers that already have it cached locally though - that’s what a “301” redirect means: “I tell you to go over here FOREVER and never ask again!”.

You should probably have used a 302 redirect if you were going to change that behavior later; I don’t know a way for YOU to programatically make someone else’s browser “forget” the 301, sadly.

Ah, of course. Thanks, that makes perfect sense. Cheers!

1 Like