WordPress wp-login undefined redirect

Solution:

Edit your wp-config.php to force the domain your WP installation is on.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

If that doesn’t work, use the Fine and Replace tool that will replace all instances of your site’s URL from your old database to your new site URL.

i.e. Find and replace.

http://localhost/

to

http://example.com/