Better implementation of //foo url handling