add 'localhost' url support for redirect