July 31, 2022, 12:53am
— SYSTEM DETAILS —
self hosted on DO
Ghost version: 5.5
Node version: 14.19.3
ghost doctor identifies no errors
— ISSUE —
After upgrade to v5.x amp versions of urls in routes.yaml > collections causes an ugly browser error: “The page isn’t redirecting properly”. The inspector tools network tab show a long chain of 301 redirects to the same url. Presumably it just times out.
Amp url from collection that causes redirect error: https://lexchart.com/docs/account/amp/
Non-amp version of same collection url returns 200: https://lexchart.com/docs/account/
Amp version of post NOT in collection returns 200: https://lexchart.com/private-equity-energy-fund/amp/
Non-amp version of same post NOT in collection returns 200: https://lexchart.com/private-equity-energy-fund/
I would like the amp urls for posts in collections to return a 200 code and load properly. Any guidance?
August 1, 2022, 6:34pm
I’m not sure what would’ve changed in v5 to cause this error.
Do you have any redirects set up in addition to your routes?
August 5, 2022, 5:41pm
I should have been more precise. I do not necessarily attribute the issue to v5. Rather, I did not experience the issue prior to v5, and do experience it after v5. The source could be something else.
The redirects.json file contains one redirect for a specific post, so I do not think that is the issue.
To anticipate a follow up, no there are no redirect rules in NGINX except for http → https, and www. → non-www. Those have been in place since day one.
I’d appreciate any suggestions. Thanks!
September 6, 2022, 7:12pm
Sorry not to have responded sooner.
Give the info here, I wasn’t able to replicate this issue.
Do you have any routes set up in addition to the collections?
Have you tried restarting Ghost?
February 1, 2023, 12:00am
@RyanF Hi Ryan, after lots of testing and experimentation, I have finally isolated the cause of this error.
Two conditions must be true:
Set up a collection with a permalink, like this:
Modify the tag taxonomy to use the tag slug, like this:
when you navigate to
/docs/some-article/amp/, the inspector shows a long series of 301 redirects and then stops with this message in the browser: “The page isn’t redirecting properly.”
Yes, adding `/tag/’ or ‘/topic/’ to the tag taxonomy route resolves the issue. However, it is removed for a reason. Adding it back would require a lot of redirect logic.
Any way to resolve this?
February 1, 2023, 2:07pm
Nice research! Let me dig into this and let you know if I can find anything more.
Any update on mark.I’s issues, because i am also getting similar issues.