add compatibility code for legacy urls