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

Homepage is error 404

Solved by pamtbaau View solution

Started by Lui Zi Sian 6 years ago · 2 replies · 611 views
6 years ago

Hey Grav community!

Basically my website worked fine before this. But recently, I tried to set up my website so that it's multilingual. So I had to create .en.md and the .fr.md files for my two different languages. (.en.md for English and .fr. is just an example of a language) Everything worked out fine, I could load my pages in two different languages. It loaded in www.domain.com/en/etc. (Note that www.domain.com is just an example, not my actual site.)

The problem came along when I searched up my website, and when I clicked the link of my website, which was still as www.domain.com, it showed up as error 404. It used to bring up my homepage, which is the file from my /home folder.

Now in order to get to that page, I have to manually type www.domain.com/en/home. And I have tried to reroute my link to that specific link but in vain. Yeah so everything is working fine except for the fact that I can't get to open my homepage from the usual link.

So after spending considerable amounts of time on this, I decided that maybe one of you guys have a clue what's going on? And maybe even better, I can set my www.domain.com link still as my default homepage, without having the /en add on. Please help a newbie out haha. Thanks in advance!

last edited 08/20/20 by Lui Zi Sian
6 years ago Solution

@zisiyan, The settings in '/user/config/system.yaml', should look something like:

MARKDOWN
languages:
  supported:                    # List of supported languages
    - en                        # (1)
    - fr
  include_default_lang: false   # (2)

home:
  alias: '/home'                # (3)

The above says:

  • (3) mydomain.com/en/home can be accessed with mydomain.com/en and mydomain.com/fr/home with mydomain.com/fr
  • (1) Use English as default language (first in list)
  • (2) Home page of default language (= en) can be accessed with mydomain.com/
    French home page remains -> mydomain.com/fr

Hope this helps...

👍 1
6 years ago

Thank you so much, it worked! Hahah I just needed to add include_default_lang: false, and it worked. You're a life saver. 🙂

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 66 18 hours ago
Support · by Anna, 3 days ago
2 72 21 hours ago
Support · by Justin Young, 22 hours ago
1 40 21 hours ago
Support · by Duc , 1 week ago
2 76 6 days ago
Support · by Colin Hume, 1 week ago
2 70 6 days ago