Mimic the way the CI HTML Helper detects URLs