问题
We made a new website for our client, Now the old website used a 301 redirect to send the user to a subfolder..
I've removed the old website and .htaccess, but the redirect is still in effect due to the caching.
Is there any way to update or undo the 301?
I can't imagine I have to send an email to all the website visitors telling them to clear their cache.
Thank you!
回答1:
TL;DR - There's not a way to remove it without clearing cache.
Workarounds are (grabbed from here):
- Put legacy content back.
- Eliminate all 301 redirects from your .htaccess / mod_rewrite config. Might as well stop causing damage first.
- Rename legacy file (perhaps append something standard), like content-123-orig.html
- Create new mod_rewrite rules to do 302 redirects from the original legacy URL to the new renamed URL. This will redirect all existing links from the legacy site to the old URLs, for any browsers without the cached 301 redirects, such as new visitors or users who clear caches.
- Create more mod_rewrite rules that do 302 redirects from the 301 redirect targets (the “new” urls that are being moved away from). This will redirect clients that were using the new site, and also will serve the correct page for clients with a cached 301 redirect – for example, browser A cached the 301 redirect, and so when you type in /content-123.html in its address bar, it instead tries to load “/products/widgets.html”. Because of the new 302 rule, it will report that “/products/widgets.html” has been moved temporarily to “/content-123-orig.html” and the user will load the legacy page contents.
来源:https://stackoverflow.com/questions/31317855/remove-a-301-redirect-from-previous-website