WordPress on a local machine redirecting to online url

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

2 s
2

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' );

Leave a Comment