My wordpress site gets redirected automatically to the old site any known solution for this?

I had recently moved my wp site from a domain to other, but when I type in the new domain’s address it gets redirected to the old domain/some_page.

Is this any common problem? Is there any known solution to this?

Read More

I had checked my code and it has no redirects to this page. Can someone give me a hand on this?

Related posts

Leave a Reply

7 comments

  1. This is because the URL settings inside WordPress are still pointing to the old WordPress site. More information is available in the Moving WordPress documentation.

    If your WordPress admin pages are still working, you can go to Settings → General, and change the WordPress URL and the Site Address to the correct values.

    If your WordPress site is completely broken, then you can add the following values to wp-config.php, which will have the same effect:

    define('WP_HOME', 'http://your_server/blog');
    define('WP_SITEURL', 'http://your_server/blog');
    

    Note that in most cases, WP_HOME and WP_SITEURL will be the same, apart from exceptional circumstances.

  2. Export the database (in .sql) and search for the domain it is redirecting to.
    If you don’t see it maybe it’s a (mu-)plugin that has old url hard coded.
    In some instances it the browser could cache the redirect so try accessing the site with private/incognito window/tab.

  3. Here’s a checklist

    1. Search and Replace domain in database
    2. Update wp-config.php with new domain
    3. Check DNS propagation
    4. Clear your cache and disable caching plugins
    5. Check web server to see if there are any server level redirects.
    6. Disable All Plugins while testing and apply default theme.

    If it still doesn’t work then please provide details of your web server hosting setup and platform.

  4. If adding the bellow is not working but only for the default directory in word press, congrats there should be no problem. You have a cache problem (if you don’t care for the reason just skip to the bottom), which you cant use the normal refresh to fix. The reason is as soon as you go the the url you get redirected to a new url and then when you refresh you actualy refresh the new url not the old cache, so the fastest fix it is just to clear the cache & history.

    define( 'WP_HOME',    'http://your_server/your_blog_url' );
    define( 'WP_SITEURL', 'http://your_server/your_wordpress_url' );
    

    special note: if you look in the wp_options table the first 2 entries also reference to the perm link
    fast command to find it bellow

    select * from wp_options limit 2
    

    Just try clearing your browser cache & history, alternatively just open it in a browser you don’t use much. If it works its a cache problem.