I have a local Xampp wordpress installation that I am using as sort of an intranet with some people I work with. I require them to be able to access it on our LAN router -- I found that I needed to change the site url and links from http://localhost:8080 to my IP http://192.168.x.xx:8080 for images and css to show.
However, I have found that when we are connected to a different router, or my travel router, this IP changes and obviously makes it not work on the LAN. I'm not really wanting to search/replace and change the site name every time a new computer and/or server is hosting the local site.
Question: So I'm really interested to see if there is a way to make the site/home URL dynamic to the hosting computer's current IP or computername. Or if I'm looking for the wrong type of solution.
I have searched extensively for a solution to this, but I feel my problem is I'm not sure what terms to search for -- or if there is a better solution. I hope someone smart could point me in the right direction.
-Based on my internet searches, I have tried a couple plugins - Relative URLs and "Root relative URLS" in hopes it would fix but it has not made a difference. -I have also set a static IP address in my travel router - however, the problem persists that I would need to change the ip address in the site if the computer changes. -I've also tried this in my wp-config:
<?php define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); //add the next line if you have a subdirectory install define('WP_SITEURL', WP_HOME . '/wordpress');