How to fix 301 redirect loop in the client browser

27 Views Asked by At

I have two domains. Let's say aaa.com and bbb.com. Aaa.com was for a long time redirected to bbb.com with a 301.

bbb.com is the site that is currently live but this is on the domain that we do not want to be the main domain anymore.

We now want to start using aaa.com as the main domain. The users browsers however have a 301 redirect cached from aaa.com to bbb.com.

How can I fix this so that I can automatically break this loop without expecting the users to remove their cache.

I was thinking of some solutions where I use a third domain or a subdomain temporarily, but can't think of a real good idea. Hope someone can point me in the right direction.

flowchart TD
  aaa.com -->|301| bbb.com
  bbb.com -->|Need this one| aaa.com

Not sure how relevant it is, but aaa.com is already available in CloudFlare, bbb.com is on another hosting. I also have access to the code of both websites, so can do something in there too. Changing DNS records are also an option.

0

There are 0 best solutions below