Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

How to set href="/" to href="/home"?

Solved by Anto View solution

Started by Anto 6 years ago · 2 replies · 677 views
6 years ago

This is my first post to this forum, so greetings to everybody.

I have been digging this forum and the documentations of Grav. But I still cannot find the solution for the problem that I have.

I am redirecting all requests to https://mydomain.com and https://mydomain.com/ into https://mydomain.com/home in my nginx web server. In Grav, I have set the following for the landing page "Home" :

user/config/system.yaml

YAML
 home:
   alias: /home
   hide_in_urls: false

user/pages/01.home/default.md

YAML
 slug: home 
 routes:
    default: /home
    canonical: /home
    aliases:
        - /home

I am not sure where else should I set. As so far, I always get href="/" instead of href="/home" on the resulting html page.

What did I miss please?

Thanks a lot in advance for your help.

last edited 12/15/20 by pamtbaau
6 years ago

Is hacking the codes the only solution for this simple problem?

I can definitely do that. But my changes will definitely over written every time I update my Grav CMS. So I am looking for the proper solution if that would exist at all.

6 years ago Solution

It is actually not the kind of hacking that I previously imagined. It is just a matter of setting the href= in the theme that I am using.

If it would be the kind of hacking to change the behaviour of how Grav CMS treats the /(root), I will definitely abandon Grav CMS.

Suggested topics

Topic Participants Replies Views Activity
Support · by Paul Hodges, 4 weeks ago
19 486 5 days ago
Support · by Lauw, 7 days ago
2 104 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 4 weeks ago