Yeah, that is the problem. Wordpress stores the site url in the database, so you need to edit that if the domain changes otherwise it'll just redirect to the old URL. Either go into your database using phpmyadmin and change the siteurl
and home
(in wp_options
) to your new URL, or use the following config options in wp_config.php
define('WP_HOME','http://localhost:8888/mysite');
define('WP_SITEURL','http://localhost:8888/mysite');
You could also go into MAMP's settings and change the apache port from 8888 to 80, that way you won't have to specify a port when developing locally.
If there are links/images in the content, you'll also need to change those links in the database from the old URL to the new one (because wordpress references everything absolutely); there are probably plenty of plugins available to do this, but you could just use a simple replace:
# wordpress fully change domain name:
UPDATE wp_posts SET post_content = REPLACE(post_content,'old','new');
UPDATE wp_posts SET guid = REPLACE(guid,'old','new');
UPDATE wp_options SET option_value = 'new' WHERE option_name = 'siteurl' OR option_name = 'home';