I recently had the need to add a trailing slash to http requests in a Concrete5 application (that did not have pretty urls enabled). The issue stemed from clients adding links that did not include the trailing slash. In the interest of keeping things clean, here are the rules I wanted to follow:
- Only rewrite urls that contain index.php
- Only rewrite urls where the above is satisfied and is followed by at least 1 trailing slash
- Only rewrite urls where the above is satisfied and the url ends with at least one valid character (defined below)
- Only rewrite urls where the above is satisfield and does not already end with a trailing slash