Hi,
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!
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Hi,
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 "http://domen.com/demo" opens successfully.
In main menu the absolute links like "/blog", "/services", etc.
The links works "http://domen.com/blog", "http://domen.com/services"
instead "http://domen.com/demo/blog", "http://domen.com/demo/services". 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 "domain.com/blog"
Are you using a custom theme?
Yes. Like described on https://getgrav.org/blog/theme-development-with-inheritance.
from user/config/system.yaml
"pages:
theme: areal
order:
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 = (p.active or p.activeChild) ? 'active' : '' %}
{% if p.children.visible.count > 0 %}
<li>
<a href="{{ p.url }}" class="{{ active_page }}">
{{ p.menu }}
</a>
<ul>
{{ _self.nav_loop(p) }}
</ul>
</li>
{% else %}
<li>
<a href="{{ p.url }}" class="{{ active_page }}">
{{ p.menu }}
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}
<ul {{ tree ? 'class="tree"' : '' }}>
{{ _self.nav_loop(pages) }}
</ul>
But I'm using absolute links in menu, like: <li class="nav-item ">
HTML<a class="nav-link" href="/blog">Blog</a> </li> <li class="nav-item "> <a class="nav-link" href="/forms/contact">Contact</a> </li>
Alright. Just update the links like so -
<a class="nav-link" href="{{ base_url }}/blog">Blog</a>
Great success! It works! 😂 How can I thank you?
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 5 | 60 | 8 hours ago | ||
| 0 | 62 | 7 months ago | ||
| 0 | 62 | 8 months ago | ||
| 3 | 72 | 12 months ago | ||
| 1 | 61 | 1 year ago |