1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 more
ZoomIt
says

Hello Networking Gurus,

I do all my web developing work on a Mac. It’s easy to work with and it has all the features I could dream of, except one -> IE . So I have a PC for IE testing.

I connect both with the mac and PC via a router to the internet and it’s fairly easy to test IE compatibility from the PC ( via inputing the Mac’s IP 192 .168.0.101 or so into the IE bar ). So if I have a site in a folder named test in my Mac localhost, i access it from my mac like so -> http://localhost/test and from my pc ( ie ) like this http://192.168.0.101/test .

The problem is that this does not work with WP ( or other CMSs ) installs because WP gets all it’s assets from absolute urls. So if I access http://192.168.0.101/wordpress from my PC, the source will load but the external assets won’t because they point to localhost not 192.168.0.101

Any solutions ( like a proxy or something ? ) ?

My attempted solutions

1. Renamed WordPress Address (URL) from http://localhost/wordpress to http://192.168.0.101/wordpress – works, but looking for a more elegant solution where I can keep the localhost format on my Mac

2. Accessed PC hosts file – added

localhost   192.168.0.101
to the file – did not work

Thanks!

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 more
sevenspark
Moderator
says

I agree it’s not glamorous, but I just go into the wp_options table and adjust both the ‘siteurl’ and the ‘home’ options to use the local network IP instead of localhost. Then everything works for me – and in my experience accessing the site via localhost still works – just when you navigate using the nav menu it’ll redirect you to the IP-based URL , as that’s how those absolute menu item URLs will be generated.

Note that I have the same situation as you except Linux vs PC rather than Mac – not sure if that makes an difference.

I suppose a more elegant solution might be to run a local DNS server – though to me that seems overkill.

:)

1037 posts
  • Affiliate Level 6
  • Author Level 10
  • Collector Level 4
  • Top Monthly Author
+8 more
ThemeBlvd
says
sevenspark said
I agree it’s not glamorous, but I just go into the wp_options table and adjust both the ‘siteurl’ and the ‘home’ options to use the local network IP instead of localhost.

I do this, too… except for instead of changing anything in the DB, I just have these two lines in my wp-config.php that I comment out when not testing on Windows:

define('WP_HOME','http://xx.x.x.x:8888/site');
define('WP_SITEURL','http://xx.x.x.x:8888/site'');
1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 more
ZoomIt
says
ThemeBlvd said
I do this, too… except for instead of changing anything in the DB, I just have these two lines in my wp-config.php that I comment out when not testing on Windows:
define('WP_HOME','http://xx.x.x.x:8888/site');
define('WP_SITEURL','http://xx.x.x.x:8888/site'');

Seems like a good compromise.

Thanks!

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 more
sevenspark
Moderator
says
ThemeBlvd said
sevenspark said
I agree it’s not glamorous, but I just go into the wp_options table and adjust both the ‘siteurl’ and the ‘home’ options to use the local network IP instead of localhost.

I do this, too… except for instead of changing anything in the DB, I just have these two lines in my wp-config.php that I comment out when not testing on Windows:

define('WP_HOME','http://xx.x.x.x:8888/site');
define('WP_SITEURL','http://xx.x.x.x:8888/site');

Nice idea, I like that better – easier to switch on and off – thanks for the tip!

2054 posts
  • Affiliate Level 3
  • Author Level 11
  • Collector Level 2
  • Elite Author
+11 more
bitfade
says

You can configure wordpress domain like wp.lan, then set ip for it both OSX and Windows hosts file. You will now access your wp installation on the address http://wp.lan from both systems.

by
by
by
by
by
by