I want to achieve the following. From these example URLs:
http://www.domain.com
http://www.domain.com/index.php
http://www.domain.com/folder/welcome.php
I want to get:
http://www.domain.com
http://www.domain.com/
http://www.domain.com/folder/
So I want to preserver everything except the file name at the end of URL.
I know I can build this using explode, parse url, count occurences, etc. but if someone already has a worked out solution, I'd appreciate sharing.
Thanks.