always include index.php
Bugfix: no trailing slash in nginx, so let's do something like rtrim() in PHP.

Added a unit test to make sure this works.