57

How do you clear cached redirects in Chrome?

I changed the DNS for a domain name and when I go to mydomain.com. Even though ping mydomain.com now shows it resolves to the correct IP, if I type in "mydomain.com" into Chrome, it still redirects to mydomain.com/404, which was a redirect automatically setup by the old webhost.

Clearing Chrome's browser cache has no effect, and Chrome seems to ignore /etc/hosts. I tried using a "different" URL, like mydomain.com?123, but Chrome still redirects to mydomain.com/404. Is this a bug or is there someway to clear whatever cache Chrome uses to save 301 redirects?

Cerin
  • 9,652

10 Answers10

43

The only method that worked from me is using Development tools an check on disable cache and the redirection were gone :)

reference

Salem F
  • 596
26

On desktop Chrome, deleting the last hour of browsing history works, so long as you've followed the redirect within the last hour.

On Android Chrome, visit chrome://net-internals, click the downward arrow at the top right corner, and choose 'clear cache'. That is the only solution I found for Chrome on Android.

Drew Noakes
  • 2,317
23

Open the Chrome Developer Tools (F12) Go to the Network tab and make sure Disable cache is ticked Reload (or navigate to) the page you no longer want to be redirected while keeping the dev tools open. This will clear the cached redirect. enter image description here

9

I had a similar issue with a site still re-directing to my.site.com/new-site and found the 'clear cache' via internals to work.

Redirects can be caused by a variety of things - caching by your browser, your system, the network, the site configuration itself and any in between steps.

In addition to clearing browsing history and cookies, I also tried the answers from Clear cache for specific domain name in chrome - I suggest trying answers in order of increasing complexity (e.g. start with what you're happiest with and if that doesn't work, try one of the more tricky solutions)

From https://superuser.com/users/83619/tom-auger

After opening up the developer tools (usually by pressing F12) Click + Hold on the "Reload Page" button. From the popup list, choose "Empty Cache and Hard Reload".

From https://superuser.com/users/87608/euroblaze

Here's how to delete Chrome's cookies selectively by domain or subdomain:
* go to chrome://settings/content/cookies
* type the domain name in the search box
* click delete

Sandra
  • 193
6

Quick fix: open devtools via right-click on the page ➞ Inspect, or via keyboard shortcut CtrAlti, on mac i, and then click and hold the Refresh button in the chrome toolbar as shown below, and then pick in the dropdown Empty cache and hard reload — this way you won't lose your sessions and cookies as with other suggested methods.

chrome flush URL redirects

While this is usually used to clear cached resources, such as scripts, assets, images, it also works for clearing URL redirects.

Special case: HTTP to HTTPS redirects with custom HSTS policies

If the redirect you want to clear is from http:// to https:// with HSTS policies defined, then the method above won't work, and another approach is needed:

  1. Open chrome://net-internals/#hsts
  2. Paste the domain that you do not want to be redirected to https under Delete domain security policies (see screenshot below).
  3. Click Delete.

prevent HTTPS redirect with HSTS

ccpizza
  • 8,241
3

Go to chrome://net-internals/#dns and click the Clear Host Cache button

2

On chromium 88 chrome://settings/clearBrowserData

Check "Cached images and files" and click "Clear Data"

Rejedai
  • 61
1

If it's an 301 redirect Chrome will cache it. To clear the cache, go to:

Chrome Menu > Settings > Show advanced settings... > Privacy > Click Clear browsing data...
Agu Dondo
  • 111
0

If chrome has cached your redirect, it can be challenging to clear the cache, as the redirect happens very quickly. Try:

  1. Turn off your WiFi, then load the site. It won't load (but won't redirect).
  2. With WiFi off, long press the reload button
  3. Click Empty Cache and Hard Reset
  4. Turn on WiFi

That might do the trick!

MagicSeth
  • 101
0

Just to add an alternative answer to this one if all of the options above/below fail to work for you.

One of our sites is 'protected' by an external cache / CDN and it was caching the 301 redirects, ignoring changes locally to web.config.

Flushing the external cache after making changes to the redirect rules did the trick.

CResults
  • 101