0

I'd like to migrate a URL to a new URL. Because I want to do it properly, I'm thinking of using the 301 status code plus the new URL in the headers. However, I also plan to disable the old URL completely, so eventually, it will become 401, as anything else that the server cannot find and for which there isn't a configuration.

My question is: has anyone prescribed a way in HTTP to mark the old URL as deprecated (in addition to reporting that it should also be redirected to something else)? I cannot find anything in the HTTP status codes for that.

zakmck
  • 143
  • You are going well with the 3xx and later on the 4xx – Rui F Ribeiro Feb 13 '18 at 17:40
  • 4
    I'm voting to close this question as off-topic because this is about the HTTP spec, and not specific to U&L. Perhaps https://webmasters.stackexchange.com/ ? – Jeff Schaller Feb 13 '18 at 17:41
  • I've been burned so many time using a 301 because browsers have permanently cached the redirect. I'd always start out with a 302 and after some period of time you can switch to 301. – Angelo Feb 13 '18 at 17:51
  • Sorry @jeff-schaller, is there another SE site where this is more appropriate? In a way it's Linux, because the typical Apache server where to deal with this is a Linux one. – zakmck Feb 14 '18 at 16:30
  • I mentioned webmasters already; there's also server fault. Check their topic scopes and see! – Jeff Schaller Feb 14 '18 at 16:47

1 Answers1

1

That’s the point of the 301 code; as per the RFC:

The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible.

This clearly indicates that the old URL is deprecated, and clients are supposed to stop using it and use the new one instead. You’ll find bookmarks are updated etc. in your browser when it encounters a 301.

Stephen Kitt
  • 434,908
  • Good to know. I had interpreted the 301 as redirected without a specific reason. I'll go with this, thanks. – zakmck Feb 14 '18 at 16:31