wordpress Live site redirect to localhost

I have develop a site (word press) locally and move it in to a remote server. Everything seems fine except when I click the home link it redirect to my localhost website.

To fix this what I did was,
Changed the site url and home url to web url without adding the slash after the url.

Read More

Apart from that I added the following code to wp_config.php

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

But when click the home button it still redirect in to the localsite.

I have changed wp_option table also

Related posts

Leave a Reply

6 comments

  1. you need to change url into database too

    UPDATE wp_options SET option_value = replace (option_value , 'http://www.oldsite.com' , 
          'http://www.newsite.com')         
       WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace 
       (guid , 'http://www.oldsite.com' , 'http://www.newsite.com');
    
    UPDATE wp_posts SET post_content = replace 
           (post_content , 'http://www.oldsite.com' , 'http://www.newsite.com');
    
    
    UPDATE wp_postmeta SET meta_value = replace 
        (meta_value , 'http://www.oldsite.com' , 'http://www.newsite.com');
    
  2. In wp_options table change siteurl option value to your live site url.
    If still problem exists search ‘localhost’ in your db and replace it with live site url.

  3. I would guess that 99% of web developers work on localhost and then deploy to somewhere that is obviously NOT localhost. It really annoys be that this sort of error happens. How much time is wasted by not having a live vs dev setting for this? Mine is still insisting on going to localhost. I’m going to have to search my HDD for the word localhost at this stage
    Finally found it under General Settings – Site Address URL which does not correspond to what is in wp_options.