# Redirects are not working properly

**URL:** <https://forum.ghost.org/t/redirects-are-not-working-properly/40304>\
**Category:** Developer help\
**Created:** [August 6, 2023, 11:43am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304 "2023-08-06T11:43:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thom\_Knepper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thom_knepper/32/19965_2.png) [@Thom\_Knepper](https://forum.ghost.org/u/Thom_Knepper)\
**Post date:** [August 6, 2023, 11:43am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/1 "2023-08-06T11:43:39Z")

</div>

When using the redirect YAML file, I get some sort of loop on the final URL.

My website is: yourdaily.tech  
Ghost version: v5.58.0  
Install: DigitalOcean OneClick  
Update: CLI via SSH

I have made the routes on my website slightly different from /post to /year/month/tag/post

However, when I try to update the redirects from the old URL I get a crazy long URL and a “ERROR TOO MANY REDIRECTS” page.

How to properly use either YAML or JSON to fix this issue?

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.

- **What’s your URL**? This is the easiest way for others to help you
- **What version of Ghost are you using?** If it’s not the latest, please update Ghost first before opening your topic

And

- How was Ghost installed and configured?
- What Node version, database, OS & browser are you using?
- What errors or information do you see in the console?
- What steps could someone else take to reproduce the issue you’re having?

---

<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:** [August 6, 2023, 1:13pm UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/2 "2023-08-06T13:13:07Z")

</div>

post your redirect.yaml file for help, please!

---

<div class="post-metadata">

**Author:** ![Thom\_Knepper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thom_knepper/32/19965_2.png) [@Thom\_Knepper](https://forum.ghost.org/u/Thom_Knepper)\
**Post date:** [August 9, 2023, 10:12am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/3 "2023-08-09T10:12:56Z")

</div>

```auto
301:
  /with-microsoft-their-integration-of-openai-s-chat-gpt-start-using-bing-webmaster-tools/: /2023/03/microsoft/with-microsoft-their-integration-of-openai-s-chat-gpt-start-using-bing-webmaster-tools
  /how-to-setup-google-analytics-4-ga4-in-shopify/: /2023/03/shopify/how-to-setup-google-analytics-4-ga4-in-shopify

```

---

<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:** [August 9, 2023, 10:23am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/4 "2023-08-09T10:23:26Z")

</div>

Are your redirects reversed? It’s incoming url, then final destination.

---

<div class="post-metadata">

**Author:** ![Thom\_Knepper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thom_knepper/32/19965_2.png) [@Thom\_Knepper](https://forum.ghost.org/u/Thom_Knepper)\
**Post date:** [August 9, 2023, 10:44am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/5 "2023-08-09T10:44:24Z")

</div>

Yes the old URL first, and then the new URL second.

I started the website with the base url, so domain/post-url.

And then I went to domain/year/month/tag/post-url

However it seems that the new URL comes with a never ending loop

---

<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:** [August 9, 2023, 11:02am UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/6 "2023-08-09T11:02:22Z")

</div>

Ah. So start the old url with ^ , which pins the match to the start of the line. :)

And then be sure those destination urls actually work on Ghost, by updating routes.yaml if you haven’t already.

---

<div class="post-metadata">

**Author:** ![Thom\_Knepper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thom_knepper/32/19965_2.png) [@Thom\_Knepper](https://forum.ghost.org/u/Thom_Knepper)\
**Post date:** [August 10, 2023, 9:09pm UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/7 "2023-08-10T21:09:35Z")

</div>

I actually did that, and still getting this error:

> **[With Microsoft their integration of OpenAI's Chat-GPT, start using Bing...](https://yourdaily.tech/2023/03/microsoft/with-microsoft-their-integration-of-openai-s-chat-gpt-start-using-bing-webmaster-tools/)**
>
> The last couple of months AI has become a big thing in the world. From the announcement of the public Cha GTP-3 website, which was free to use, to Microsoft buying a majority share of the OpenAI foundation. The world is all into AI right now.
> 
> 
> Your...

---

<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:** [August 10, 2023, 9:23pm UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/8 "2023-08-10T21:23:41Z")

</div>

301 redirects can be cached. Try another browser or another computer, see if the problem is fixed. :)

---

<div class="post-metadata">

**Author:** ![Thom\_Knepper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thom_knepper/32/19965_2.png) [@Thom\_Knepper](https://forum.ghost.org/u/Thom_Knepper)\
**Post date:** [August 10, 2023, 9:28pm UTC](https://forum.ghost.org/t/redirects-are-not-working-properly/40304/9 "2023-08-10T21:28:05Z")

</div>

AWESOME! You’re the best. I am updating all my links now :) 😁
