Redirect in GRAV

Good day to all! I have a problem with redirect in GRAV. I have read documentation, but in the chapter “redirects” there are no information about in what file I should to write the rule for redirect. I tried to write redirect in the header of the page “”, in the file ‘site.yaml’ and in the ‘system.yaml’, but it didn’t work:

/tutorial/algebra/fractions: ‘/tutorial/algebra/fractions/theory’

I can visit the page “/tutorial/algebra/fractions” without redirecting to the page ‘/tutorial/algebra/fractions/theory’. Tell me please, where I made a mistake?

1 Like

Hi @Gray_and_Big, I have not used system.yaml or site.yaml for redirects but have used the page header redirect

Here is an example of a redirect from to

Hope the above helps,

The docs do say “you can override or add any of your own settings by editing the user/config/site.yaml file” under the heading “Site Level Routes and Redirects”. You must have missed that.

If it’s still not working, could you expand on what “it didn’t work” means exactly i.e. what is happening?

Good luck, cheers :slight_smile:

Thanks a lot, your advice was very useful for me :slight_smile:

1 Like

Thanks for your answer, I really missed some information above the chapter “Redirects”.
I tried to create page structure like this:


So I made this folder structure:


But I didn’t want to make separate page on site for the chapter “Fractions”. When user cliks on “Fractions” it has to redirect to the “Fractions\Theory”. So I wrote the rule for routing in the header of the file “Tutorial/01.algebra/01.fractions/”

  default: '/tutorial/algebra/fractions/theory'

It worked, but another problem appeared. I suddenly found that the page “/tutorial/algebra/fractions/theory” opens on the link “/tutorial/algebra/fractions/theory/theory”, and the page “/tutorial/algebra/fractions/practice” opens by the link “/tutorial/algebra/fractions/theory/practice”. I was really surprised, because I wrote the rule for routions only for one page. After that happened I tried to found the rule for redirect :slight_smile: I wrote redirect in the file in the folder “Fractions”, in the file site.yaml and system.yaml, but redirect didn’t work. Now I understand, that my mistake was that I wrote redirect like this (I copied this example from documentation):

/jungle: '/blog/the-urban-jungle'

But correct rule for redirect is this:

redirect: '/tutorial/algebra/fractions/theory'

1 Like


What if you don’t put a file in your 01.fractions folder ?

I deleted the file from folder ‘01.fractions’ and received 404-error when pressed ‘Fractions’ in the main menu of the site.

1 Like