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…
192.234.2.32:8888
(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
I use xip.io for this.
Use a static IP address for DHCP:
In MAMP PRO, select the host
1
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 articleBefore 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
: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.Related:
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/