Rewrites not working?

Hey,

Having some trouble setting up some Rewrite rules for a static site.

https://landy.app/blog works as expected.

https://landy.app/blog/hello-world however redirects to landy.app/hello-world

Have i set something up wrong here?

Hello! The way you’ve set up these rewrite rules seems correct, but it looks like https://landy-blog.onrender.com/hello-world is itself returning a 301 redirect (to /hello-world/), which is then causing https://landy.app/blog/hello-world to redirect to https://landy.app/hello-world/. If instead https://landy-blog.onrender.com/hello-world returned the same thing as https://landy-blog.onrender.com/hello-world/ (200 status with the blog content) I think things would work as you want. So in short redirecting when there’s no trailing slash may be the issue here. Does that make sense?

1 Like

Thanks so much David, leaving this here:

in case anyone else is having problems with rewrite rules & ghost

1 Like

Thanks for sharing the link!