Add redirect function to invoid cross-domain problem