MAMP PRO testing local WordPress website with xip.io over LAN from iPhone not loading images css correct links etc

Hiall,

I’m trying to simply test my local MAMP PRO wordpress site on my iPhone through my local LAN network.

Read More

I test my on my Mac via the URL which works fine
http://mysite:8888/

For my iPhone
If I go to MAMP PRO select my website/host from the left column and check the via Xip.ic (LAN only) option/checkbox
it provides a URL which is
http://mysite.10.0.1.6.xip.io:8888

I then send myself an email with this link which I click from the iPhone

When I load http://mysite.10.0.1.6.xip.io:8888 in my iPhone, the URL loads and I can see my website but there is no images, or CSS styling, the sites links are not correct and I only see the sites text.

I understand I need to change the site to load like its loading from mac to my iPhone urls and that I can change the

WordPress Address (URL)
Site Address (URL)

without having to do it in the wp-admin settings screen by adding by doing

  define('WP_HOME','http://mysite.10.0.1.6:8888');
  define('WP_SITEURL','http://mysite.10.0.1.6:8888');

but this does not make a difference either

I’ve also tried

 define('WP_HOME', 'http://mysite.10.0.1.6.xip.io:8888');
 define('WP_SITEURL', 'http://mysite.10.0.1.6.xip.io:8888');

I’ve found various examples like
https://wordpress.stackexchange.com/questions/98386/testing-local-server-with-mamp-wordpress-on-mobile-device
http://www.designshifts.com/view-local-wordpress-website-on-your-iphone-or-ipad-with-mamp/

which I have spent hours trying to replicate but I just can’t figure it out!

I’m not sure if it’s because I’m typing my urls / ports different/incorrectly and typing my URL’s incorrectly to include ports etc, or because I have the latest version of MAMP PRO and Yosemite and these examples are a few years old etc, or maybe I need to be clearing the the word press / MAMP cache, restarting on every atempt etc?.

Any help would be greatly appreciated!

Related posts

Leave a Reply

3 comments

  1. If you already have replaced the home and siteurl in the General Settings. Note: Wp-config alternative hack as you mentioned didn’t work for me.

    In Mamp Pro, select your host e.g. (example.dev).

    1. Check “via Xip.io (LAN only)
    2. Under Alias Name, Add your system’s static IP (e.g. 192.168.15.4). Default settings will work
    3. Save and Restart servers.

    Your Images and CSS should appear. BUT links are still not working. I hope you’d help me improving the answer.

  2. In the WordPress settings, change the below:

     define('WP_HOME', 'http://mysite.10.0.1.6.xip.io:8888');
     define('WP_SITEURL', 'http://mysite.10.0.1.6.xip.io:8888');
    

    To your device local network I.P. address, for example:

     define('WP_HOME', 'http://192.168.0.71');
     define('WP_SITEURL', 'http://192.168.0.71');
    

    This will work!

  3. To be honest, the simplest way I have found is to just go into your database and look for siteurl and home which are normally record 1 & 2 in the database, and update it to your network IP address.

    It can then be visited in the browser from that IP address for anyone on the network.

    WordPress just isn’t built to make xip.io work because it defines the site name statically.

    enter image description here