Force browsers to forget cached redirects?

前端 未结 1 1380
说谎
说谎 2021-01-17 10:22

I inherited a domain that previously had a 301 redirect from the root (\"/\") to \"/index.shtml\"

I\'ve removed the redirect and a different site on the domain, but

相关标签:
1条回答
  • 2021-01-17 10:27

    The short answer: There is no way to tell the browsers of the users to "forget" the R 301 redirect. 301 means permanent, it can be only undone on action of the user or when the cache expires.

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2

    Similar Q and A on Stackoverflow: Apache - how to disable browser caching while debugging htaccess, Cannot remove 301 redirect

    Try to avoid 301 redirects and use 302 (temporarily) instead. Here is an article how to set no cache for 301 redirects (didn't try it): https://github.com/markkolich/blog/blob/master/content/entries/set-cache-control-and-expires-headers-on-a-redirect-with-mod-rewrite.md

    What you could do in your scenario: You could add a header redirect to the file index.shtml, which sends the user to the original file, where he should usually go.

    0 讨论(0)
提交回复
热议问题