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

Trailing slash at end of URLs

Started by Leuv 8 years ago · 6 replies · 2262 views
8 years ago

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.

last edited 01/14/18 by Leuv
8 years ago

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

👍 1
8 years ago

I only found it:
342424|690x86

..but it does not solve my problem.

8 years ago

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.

8 years ago

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.

8 years ago

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.

8 years ago

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.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 57 15 hours ago
Support · by Anna, 3 days ago
2 65 18 hours ago
Support · by Justin Young, 19 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago