legacy url middleware