Unable to Access WordPress admin after moving to root domain

I have a website launch on sub domain (sub.domain.com) and all working fine there. I transferred it to root address (domain.com) by following steps.

  1. Downloaded all the file contents from sub domain directory.
  2. Uploaded all those content to root directory.
  3. Downloaded db script of the sub.domain.com install of WordPress.
  4. Replaced all addresses from sub.domain.com to domain.com by notepad
  5. Uploaded this script as new DB and added credentials in wp-config.php of root domain’s WordPress.

The issue now I am facing is that it when I try to access the /wp-admin of new root domain’s WordPress it doesnot accept them.

Read More

I created a admin user directly into db from this site, but it also is not working.

Related posts

Leave a Reply

1 comment

  1. Whenever you move a WordPress site, you need to properly adjust configurations in your WordPress install in the wp-config.php file on the following variables:

    define('WP_SITEURL', 'http://domain.com/wordpress');
    define('WP_HOME', 'http://domain.com/');
    define('WP_CONTENT_DIR', '/path/to/your/wordpress/wp-content');
    define('WP_CONTENT_URL', 'http://domain.com/wp-content');
    

    This will force your install to use the domain.com URLs. Also, when you do this the first time set the RELOCATE setting to true like this:

    define('RELOCATE', true);
    

    That basically tells WordPress to rejigger (that’s my technical term for it) it’s stored settings for the new settings. And after you have reloaded your site & it works as expected, set RELOCATE setting back to false like this:

    define('RELOCATE', false);