Tweak URL matching for templates.