Here's a recurring problem. There are similar questions on SO about this, but nothing quite answers my question.
I've got a website and I want every page to be available at only one URL. It should work dynamically on all pages, not on a sinlge hard-coded filename.
domain.tld/foo
should redirect todomain.tld/foo/
domain.tld/foo.php
should redirect todomain.tld/foo/
domain.tld/foo/
should give the user (but not redirect him to)domain.tld/foo.php
1 and 3 are not too hard, but I can't figure out 2 without introducing a circular reference and failing with too many redirects. How would I be able to do this?