I am currently developing a wordpress site locally using MAMP PRO, which obviously involves using a local database.

I would like to test this site on my iPhone via a remote link. I have managed to do this by typing the following into my mobile phone URL... 

(IP Address : Port number)

The problem is the index page is displayed but with no CSS styling. Then when I click on another page, it says the page cannot be found

It seems it has connected to the server properly, but not to the wordpress database. (at least I think this is the problem)

Does anyone have any information on how to get this working or point me in the right direction? Do you need another application to do this, or can it be done with mamp/IP address etc?

Thanks in advance

  • if you've used absolute urls like http://something.com/some... then probably you'd have to change everything. But if you've used relative urls then including site_url('ip_here:port') might be usefull. If you declare site_url() in wp-config then you can use it to add scripts and css. – SachinGutte May 5 '13 at 16:56

I use xip.io for this.

What is xip.io?

xip.io is a magic domain name that provides wildcard DNS for any IP address. Say your LAN IP address is Using xip.io,   resolves to
    www.   resolves to
 mysite.   resolves to
foo.bar.   resolves to

Use a static IP address for DHCP:

static dhcp IPv4 Address

In MAMP PRO, select the host1 you want to use (wp99.dev in this example), and in the Advanced tab use the following as ServerAlias for the general settings:
1 instructions for Apache too in the linked article

ServerAlias wp99.*.xip.io

Before applying the changes and restarting the servers in MAMP, change the settings of the site:


Save the changes in WordPress, restart the servers in MAMP, login to the site.
Test on any device/computer of the local network.

Instead of changing the site settings, an interesting technique to use in wp-config.php:

if( b5f_browser_check( 'mobile' ) )
    define( 'WP_HOME', "http://wp99.{$_SERVER['SERVER_ADDR']}.xip.io");
    define( 'WP_SITEURL',"http://wp99.{$_SERVER['SERVER_ADDR']}.xip.io");

This way, the desktop version keeps the nice address, and when viewing in mobile the xip.io address is served.

Here's a Gist for the file b5f-browsers.php, which uses Chris Schuld's Browser.php class.


  • 1
    Awesome tutorial. A pity it's attached to a question that was marked as "off topic". Thanks anyway! – pixeline Sep 20 '13 at 8:03
  • 1
    @pixeline, yep, and I knew it was off-topic, but couldn't avoid publishing ;) Just updated with a wp-config technique for not using that ugly xip.io address in the desktop. – brasofilo Sep 20 '13 at 22:19

Have answered my own question, found this great article which did the trick http://www.designshifts.com/view-local-wordpress-website-on-your-iphone-or-ipad-with-mamp/

  • Link only answers are discouraged. Please edit this so that it contains all of the relevant information. – s_ha_dum May 5 '13 at 15:06

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