Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i've downloaded a wordpress web to my local machine and tried setting it up. the problem: when trying to login, wordpress will always redirect to the online url. the only way i found was changing the siteurl manually in phpmyadmin to my local machine's ip address. is there a better solution? the problem about doing that is that permalinks won't work anymore locally.

thanks

share|improve this question
    
Not sure why that means the permalinks don't work locally anymore? –  Joel Glovier Oct 19 '12 at 18:55

2 Answers 2

up vote 3 down vote accepted

Open up your wp-config.php file

try adding the following to it:
define( 'WP_SITEURL', 'http://localhost/your_wordpress_folder' );
define( 'WP_HOME', 'http://localhost/your_wordpress_folder' );

share|improve this answer
1  
the only thing to add here is to go to Settings > Permalinks and resave, so that you get a correct .htaccess file –  anu Feb 15 '11 at 12:12

If I understand right you had restored backup of live site to local installation?

Basically you have two ways to handle it:

  1. Change site URL (I recommend RELOCATE way, always works nicely for me).

  2. Use hosts file of your OS to point live domain at your local IP (127.0.0.1).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.