Kentico remove trailing slashes in a URL

80 views Asked by At

How do I remove trailing slashes in a URL.

For example: I want this url https://test.com/mypage/ to redirected to https://test.com/mypage

The fix should not affect the admin site. Fix is only needed for the public site.

We are using Kentico 12 MVC version

2

There are 2 answers

0
jurajo On

For performance reasons I would do this on the IIS level using URL rewriting rule you can find on Google or here on SO there are many threads on this topic how to do it in MVC routing. E.g. Remove Trailing Slash From the URL

0
Trevor F On

12 kind of sucked for options... 13 has a settings to adjust the URL including trailing slash or not. For 12 though you usually had to manually do routing, or use the pattern on the page type, so indeed it may be just an issue with your MVC setup instead of kentico.