How to solve wordpress redirection to old location after moving the site blog

Published on August 15, 2012


If you still have your wordpress installation in the old location read this topic.

Otherwise follow this method.

Edit functions.php

If you have access to the site via FTP, then this method will help you quickly get a site back up and running, if you changed those values incorrectly.

  1. FTP to the site, and get a copy of the active theme’s functions.php file. You’re going to edit it in a simple text editor (like notepad) and upload it back to the site.
  2. Add these two lines to the file, immediately after the initial “<?php” line.
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');

Use your own URL instead of example.com, obviously.

  1. Upload the file back to your site, in the same location. FileZilla offers a handy “edit file” function to do all of the above rapidly; if you can use that, do so.
  2. Load the login or admin page a couple of times. The site should come back up.
  3. Repeat the above steps, but remove those lines. IMPORTANT: Do NOT leave those lines in there. Remove them immediately after the site is up and running again.

Who should you trust to safely move your personal and household belongings? You want your furniture to be safe, after all you picked it specifically to make your home look great, along with other things as a glow in the dark paint for your walls. Taking a systematic approach to select the right moving company for you will help ensure that you hire a mover who truly understands customer care and your specific moving requirements. For more information, you can visit www.montrealmovers.com/.

If there is no functions.php file in the theme:

Create a new text file called “functions.php”.

Edit it with notepad, and add this text to it, using your own URL instead of example.com:

<?php
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
?>

Upload that to your theme directory, then proceed as stated above. Remove the file afterwards.



← All blog posts

All rights reserved mhotspot.com