Rather than my Ghost site’s default view being a list of blog posts, I’ve created a page (stored at mydomain.com/index) that I’d like people who navigate to my base domain to be redirected to.
Similarly, I have a couple other pages that I’d like to store in custom slugs. For example, I have a “mydomain.com/charts” page that I’d like to store under “mydomain.com/data/charts”, and so on.
What would be the best way to accomplish this?
I think I would use redirects here. You could redirect from /index to your root path and /charts to /data/charts/.
I initially tried adding something like this to my redirects file:
301:
/: /index
/chart: /data/charts
However, after configuring, visiting mydomain.com redirected me to mydomain.com/index/index/index/index and kept redirecting. The same thing happened w/ the data/charts.
Is there a different way to tell Ghost - when someone wants to access this page, send them here instead?
In your redirect, you need to add some regex (pattern matching) to avoid the duplication.
Try this:
301:
^\/$: /index/
Does that work?