Hi there! This blog post was published over 18 months ago. A lot can change in that time, so some of the information might now be outdated. It’s worth verifying the details or checking for newer updates.
Building on my previous post How to remove trailing slash in Umbraco 8, removing the traling slash in Umbraco 9 (RC) is just as easy.
I still think the trailing slash is messy, and urls are much nicer without it, also much more user friendly, and Google states the trailing slash doesn't affect SEO at all.
The setting now lives in the appsettings.json
file within the Umbraco -> CMS
properties.
After RuntimeMinification
add a comma (,) and then paste in the below boolean property:
"RequestHandler": {
"AddTrailingSlash": false
}
Below you will find an example of my upcoming project in V9
"Umbraco": {
"CMS": {
"ModelsBuilder": {
"ModelsMode": "SourceCodeManual",
"AcceptUnsafeModelsDirectory": true,
"ModelsNamespace": "SecretNewProject.Shared.Models.PublishedModels",
"ModelsDirectory": "~/../SecretNewProject.Shared/Models/PublishedModels"
},
"Global": {
"DefaultUILanguage": "en-GB",
"VersionCheckPeriod": 0,
"Smtp": {
"From": "[email protected]",
"Host": "localhost",
"Port": 25
}
},
"Hosting": {
"Debug": true
},
"RuntimeMinification": {
"useInMemoryCache": true,
"cacheBuster": "Timestamp"
},
"RequestHandler": {
"AddTrailingSlash": false
}
}
}
That's all there is to it!
About the author
Aaron Sadler
Aaron Sadler, Umbraco MVP (2x), Umbraco Certified Master Developer and DevOps Engineer