Trailing slash at end of URLs

The default URL format in Grav:
domain.com/contact (without slash at end of url)

I would like to change it so that the system will default add slash at the end od urls, e.g.:
domain.com/contact/

How to do it? I don’t want to add redirects to .htaccess. I would like the system to add slash by default at the end of each url.

There is an option in Configuration->System for trailing slash

1 Like

I only found it:

…but it does not solve my problem.

This option is really only to handle external links that have a trailing slash to be redirected to the URL without it. While Grav ‘supports’ URLs with a trailing slash, the default URLs do not have them.

You would have to disable the Redirect trailing slash option, and then at the end of all your URL links, add a \ manually.

Could you please provide an example, How to append ‘/’ to URL’s.

My current solution is to append ‘/’ using JavaScript. But that does not work properly with SEO.

Thank You.

Having a trailing slash on URL’s is not going to help your SEO. Google doesn’t care either way. See https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html

In other words the default Grav setup is great. As long as you don’t link to the page version with the trailing slash in your backlinks (which will hit the redirect anyway if you leave it on, which you should) then it’s just as strong as having a trailing slash.

Hi again,

Can you check if you have the same problem?
Enter address:
domain.com////////

You should be redirected to domain.com, unfortunately it does not work.