How to make routes point to the same page? (routes.yalm)

Hello,

I have created a page that can be accessed at domain/somePage/
How can I make it so that if I navigate to domain/somePage/somethig/ or domain/somePage/somethig/somethingElse/ renders domain/somePage/ without redirecting.
Basically domain/somePage/(.*) to always open domain/somePage/ but without redirecting (something similar to mod_rewrite)

:slight_smile:

  • What version of Ghost are you using? 2.2.4

As far as i understand, you want to show the same content on multiple urls?

Yes.

Any ideas how to do it?

I think you could do something like this (not tested).

routes:
  /page1/:
    data: page.static
    template: example

  /page2/:
    data: page.static
    template: example

example.hbs

{{#page}}
  {{content}}
{{/page}}

Can I use regex?
What I mean is, if i have url:
/page1/page2/page3… to show /page1
/test1/test2/test3 to show /test1
Without redirecting, keeping the url in the browser unchanged.

No

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.