How to add trailing slashes to the end of a CraftCMS URI
A step by step guide to adding trailing slashes to the end of a URI/URL.


A step by step guide to adding trailing slashes to the end of a URI/URL.
SubscribeHow to create & setup a Craft CMS project
The following tutorial demonstrates how to add a trailing slash to the end of a URI/URL in CraftCMS.
We would like to thank the support team at CraftCMS for giving us the tip of how to do this.
Step One: Update the CraftCMS Config

In the general.php file of your CraftCMS codebase, add the following line:
->addTrailingSlashesToUrls(true)
Step Two: Check

Refresh the browser and check that the URI now adds a trailing slash to the URI/URL in your development environment.
Step Three: Deploy

Deploy the change and confirm that it appears on your hosted CraftCMS.
Looking to learn more about CraftCMS?
Search our blog to see the rest of our tutorials on CraftCMS.