Wordpress wp-admin redirects me to a different domain

40,047

Solution 1

Go to your database, and find the table called wp-option, then change the wordpress address and site address to mysite.net.

You can also add the following lines of code to the wp-config.php-file

define('WP_SITEURL','http://your-site-url.com');
define('WP_HOME','http://your-site-url.com');

Solution 2

The above answer didn't work for me. See:

change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar)

Share:
40,047
cyberscientist
Author by

cyberscientist

Updated on March 16, 2020

Comments

  • cyberscientist
    cyberscientist about 4 years

    I go to mysite.net/wp-admin. Once I type in my username and pass word it redirects me to a blank page with address of

    mysite.co.uk/wp-login.php?redirect_to=http%3A%2F%2Fmysite.net%2Fwp-admin%2F&reauth=1

    I own both domains mysite.co.uk and mysite.net. in fact mysite.co.uk redirects to mysite.net

  • mmell
    mmell over 11 years
    After using this config solution you can log in to wp-admin and change the db settings on the General Settings page (/wp-admin/options-general.php). Apparently the config overrides the db values so once logged on, remove the config settings, then update the General Settings values.
  • bubakazouba
    bubakazouba almost 9 years
    my wp-config.php doesnt have these 2 lines
  • KhoPhi
    KhoPhi almost 9 years
    @bubakazouba What prevents you from adding the "these 2 lines"?
  • abibock_un
    abibock_un over 5 years
    Sometime you will need to update wp_option table row with the key: "wordpress-https_ssl_host"