admin管理员组

文章数量:1122846

I have a local WordPress install running through MAMP. It's local domain is example.dev

I also have the install working with xip.io. It's at example.dev.0.0.0.0.xip.io (0's being my ip address).

Right now the only way I seem to be able to get xip.io working is to add

define('WP_HOME', '');
define('WP_SITEURL', '');

to my wp-config.php file.

This forces anyone going to example.dev to go to example.dev.0.0.0.0.xip.io

The issue is at the office, my computer has a static IP address. At home, it does not. So if I am in the office and go to example.dev.0.0.0.0.xip.io in my local browser or in a browser on the network, it all works fine.

But if I am at home, example.dev redirects to example.dev.0.0.0.0.xip.io which does not work because my IP is no longer static.

So I need to be able to view the site locally at example.dev and on a LAN connected computer at example.dev.0.0.0.0.xip.io thus eliminating the static IP issue when I'm at home.

Any help would be appreciated!

I have a local WordPress install running through MAMP. It's local domain is example.dev

I also have the install working with xip.io. It's at example.dev.0.0.0.0.xip.io (0's being my ip address).

Right now the only way I seem to be able to get xip.io working is to add

define('WP_HOME', 'http://example.dev.0.0.0.0.xip.io');
define('WP_SITEURL', 'http://example.dev.0.0.0.0.xip.io');

to my wp-config.php file.

This forces anyone going to example.dev to go to example.dev.0.0.0.0.xip.io

The issue is at the office, my computer has a static IP address. At home, it does not. So if I am in the office and go to example.dev.0.0.0.0.xip.io in my local browser or in a browser on the network, it all works fine.

But if I am at home, example.dev redirects to example.dev.0.0.0.0.xip.io which does not work because my IP is no longer static.

So I need to be able to view the site locally at example.dev and on a LAN connected computer at example.dev.0.0.0.0.xip.io thus eliminating the static IP issue when I'm at home.

Any help would be appreciated!

Share Improve this question edited Oct 23, 2017 at 19:33 Nick Taylor asked Oct 17, 2017 at 16:42 Nick TaylorNick Taylor 1379 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Could this be resolved by a hosts file entry that always routed relevant host requests back to local host?

本文标签: urlsHow to properly setup MAMP and XIP