Install grav in a secondary directory

I need to install grav in a secondary directory.
I tried different ways but nothing.
Where and what I have to change?
Everytime grav system get out a terrible error 404…

Help, please!

The same problem.
GRAV installed in the subfolder “html/demo”
“html” - is root hosting folder, like “www”, “public” etc.
Index page at “” opens successfully.
In main menu the absolute links like “/blog”, “/services”, etc.
The links works “”, “
instead “”, “”. I tried to change the site URL in system.yaml and htaccess, the routing from admin-panel. I think it’s a simple task, but I can’t solve it. I tried a lot of options reading the documentation.

Have you also tried setting ‘Custom base URL’ setting in the system configuration?

I just tried it again. Still treated as “

Are you using a custom theme?

Yes. Like described on
from user/config/system.yaml
theme: areal
by: default
dir: asc”

Ok. It is quite likely that your theme is creating links with href=/blog etc. Can you post the theme’s navigation snippet?

{% macro nav_loop(page) %}
{% for p in page.children.visible %}
{% set active_page = ( or p.activeChild) ? ‘active’ : ‘’ %}
{% if p.children.visible.count > 0 %}

  • {{ }}

      {{ _self.nav_loop§ }}

  • {% else %}

  • {{ }}

  • {% endif %}
    {% endfor %}
    {% endmacro %}
      {{ _self.nav_loop(pages) }}

    But I’m using absolute links in menu, like:

  •                     <a class="nav-link" href="/blog">Blog</a>
                    <li class="nav-item ">
                        <a class="nav-link" href="/forms/contact">Contact</a>
  • Alright. Just update the links like so -

    <a class="nav-link" href="{{ base_url }}/blog">Blog</a>
    1 Like

    Great success! It works! :joy: How can I thank you?