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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

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

Solved by Anto View solution

Started by Anto 6 years ago · 2 replies · 565 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 Thomas, 1 week ago
2 55 12 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 16 hours ago
1 31 16 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 58 5 days ago