Take the 2-minute tour ×

I develop sites in MAMP on my local network so I've decided to setup port-forwarding to open up my external network and allow HTTP traffic to go directly to my localhost.

Everything is working fine and I can access my MAMP folder using my static IP but,

All my WordPress installs are using http://localhost as the prefix and the images/css/js aren't working when accessing the site outside the local network.

Is there anyway I can tell MAMP to redirect ALL localhost traffic to my static IP? I was modifying the vhosts file but to no avail.

Any help would be greatly appreciated

share|improve this question
Change the Site URL in your WordPress admin to http://xxx.xxx.xxx.xxx instead of http://localhost? –  Dan Grossman Aug 2 '11 at 18:05
Yeah I did that, but I have 20+ sites in there and it won't work for images/posts that are already uploaded unless I go into the database table and do a search and replace. –  kinsey Aug 2 '11 at 18:16
Why would you have hardcoded links to http://localhost in the database? –  Dan Grossman Aug 2 '11 at 18:17
The sites were all developed using localhost as the SITE url so when you upload an image in a post/page wordpress uses that URL when it makes its absolute URLS. –  kinsey Aug 2 '11 at 18:21
add comment

1 Answer

I know this isn't a direct answer to your question, but I've had the same issue and have successfully used this plugin to migrate sites from localhost to the production domain. http://wordpress.org/extend/plugins/search-and-replace/.

Note: I've never had any issues, but please backup your db first. Better safe than sorry.

share|improve this answer
add comment

Your Answer


