# Undoing a redirect loop

**URL:** <https://forum.ghost.org/t/undoing-a-redirect-loop/26795>\
**Category:** Routing\
**Created:** [November 12, 2021, 7:14pm UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795 "2021-11-12T19:14:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/steve_1/32/10075_2.png) [@Steve\_1](https://forum.ghost.org/u/Steve_1)\
**Post date:** [November 12, 2021, 7:14pm UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795/1 "2021-11-12T19:14:47Z")

</div>

I was trying to redirect my landing page, and ended up sending my posts into a redirect loop. I uploaded a new redirects.yaml. It didn’t work, and I got stuck in a redirect loop:

I tried:

```auto
302:
    /: /welcome-to-streamduo

```

When I go to “[https://streamduo.ghost.io](https://streamduo.ghost.io)” I end up at:

[Domain error](https://streamduo.ghost.io/test-post/welcome-to-streamduo/welcome-to-streamduo/welcome-to-streamduo/)…

and so on…

I tried to fix by resetting the redirects.yaml to be empty:

```auto
301:
302:

```

I un-cached chrome, and tried it in incognito and guest, still seeing the issue.

Any ideas on how I can address? Any options to wipe the redirects clean?

Thanks.

---

<div class="post-metadata">

**Author:** ![indirect](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/indirect/32/20521_2.png) [@indirect](https://forum.ghost.org/u/indirect)\
**Post date:** [December 1, 2022, 6:00am UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795/2 "2022-12-01T06:00:12Z")

</div>

In local development, I was able to resolve this by restarting Ghost (`ghost restart` using the CLI tool). In my production Ghost Pro site, I haven’t been able to find any way to fix this at all. What are we supposed to do when this happens, exactly? The docs say that uploading an empty `redirects.yaml` file will remove all redirects, but that clearly isn’t true if these infinite loops get stuck and stay there regardless.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [December 1, 2022, 11:16am UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795/3 "2022-12-01T11:16:07Z")

</div>

If you upload a redirects file with a 301 redirect, you are creating a _permanent_ redirect.

The 301 status code tells everything between you and Ghost: your browser, your ISP, your server etc that they can cache that 301 status forever.

If you upload a new file without the 301 redirect, Ghost removes the redirect, but all the hops between you and it have no way to know they’re not supposed to serve that cached 301 anymore. So you’ll need to clear your browser cache, and any caches on your server… and even then it _can_ still persist.

If you’re having this problem with a Ghost(Pro) site specifically, then you’ll need to reach out to support to help clear some of the intermediary caches.

---

<div class="post-metadata">

**Author:** ![Mike\_Jones](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mike_jones/32/25647_2.png) [@Mike\_Jones](https://forum.ghost.org/u/Mike_Jones)\
**Post date:** [July 29, 2023, 6:48pm UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795/4 "2023-07-29T18:48:31Z")

</div>

I had this same issue. And clearing my browser cache worked!

Now how do I redirect like this without it going into an endless loop:

```auto
302:
    /: /homepage

```

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [July 29, 2023, 8:19pm UTC](https://forum.ghost.org/t/undoing-a-redirect-loop/26795/5 "2023-07-29T20:19:00Z")

</div>

change that line to:

```auto
  ^/$: /homepage

```

The ^ means start of line, and the $ means end of line.

However, if what you’re trying to do is to serve a special page at /, you should probably be looking at routes.yaml instead. Have a look here: [Ghost Themes - Dynamic URLs & Routing](https://ghost.org/docs/themes/routing/#using-a-custom-homepage)
