Handling trailing slash in URLs

By default Yii handles URLs without trailing slash and gives out 404 for URLs with it. It is a good idea to choose
either using or not using slash but handling both and doing 301 redirect from one variant to another.

For example,

/hello/world - 200
/hello/world/ - 301 redirect to /hello/world

Using UrlNormalizer

Since Yii 2.0.10 there's UrlNormalizer class you can use to deal with slash and no-slash URLs in a very convenient way.
Check out the "URL normalization" section in the official guide for details.