Redirect causing an issue where slug repeats indefinitely

//I cannot share the URL here as it is currently under embargo. I can share privately via PM if needed.//

I am trying to redirect my homepage to a blog post for a “soft launch” of my website, so subscribers can sign up early without seeing the rest of the site as I continue to work on it. I have uploaded the redirect properly and Ghost has accepted it, but when I test it out, the redirect sends me to my site with the destination slug repeated indefinitely (i.e., /redirect-to/redirect-to/redirect-to/redirect-to/redirect-to/redirect-to/…etc).

Thanks in advance for your help!

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue
  • What version of Ghost are you using?
  • What configuration?
  • What browser?
  • What errors or information do you see in the console?
  • What steps could someone else take to reproduce the issue you’re having?

Can you share the redirects file? I assume you’re just forwarding / to the new slug? That would then match on any request to your site, both / as well as /anything/, /anything/anything/, etc. – perfect loop :smiley:

1 Like

The trick on redirects is to start the match with ^ and end it with $, which match the start and end of the path - that avoids most of the loopy behavior. So…

301 (or 302):

^/$: /some-blog-post/

2 Likes

ahhh you’re an angel, this is exactly what i did wrong. can i fix this with cathy’s suggestion below?

thank you so much cathy!!! implementing this now.

1 Like