• So, I host a web local server that is not accessible to online users, only for a large local network, I used to have a plain old HTML page with an Apache server on a Linux machine, then I decided that It’s time to refresh the look of it and got WordPress up and running, when setting up WordPress I used localhostas my “address” or the web page since it would only be accessible from the local network. The local network is large and has several subnets with different rages of IP addresses, now the server has access to all of them, but when a user tries to access the site it redirects them to localhost, which of course is stupid because the server is not on their local host. Okay, no biggie, I’ll just put the IP address of the machine as the “address”, now users from one subnet can access the site with no problems, but users from another subnet get redirected to an IP address that is not in their subnet range and cannot access it. When I was hosting the page on a local Apache server this was not happening, why is it redirecting people to an address they can’t access? Same thing for when I try to access the website from a VPN, The address that the machine has on the VPN is obviously not the same as on the local network, but I still get redirected to the local address. The fun part is that the HTML loads just fine, There’s just no CSS, no Plugins, no animations. This is so weird to me, and I cannot figure out how to stop it from redirecting uses to another IP address. Is there a way to set up multiple addresses? One for each subnet that the server is connected to.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Why is wordpress so picky about the adress you use?

    Not really true: WordPress just needs ONE address — ANY address — as long as that address is routable over your network (which localhost isn’t).

    That ONE WordPress address is stored in the database and used as absolute URLs for all site assets (images, CSS, JS, etc).

    That would explain why you have broken CSS and whatnot, as your site is internally using localhost over the network, which obviously doesn’t work.

    To address the kind of problem you’re facing:

    1) Make up ANY host address. It doesn’t have to be a publicly registered domain: just configure your local DNS server to revolve this address over your own network, taking care to ensure it consistently points to the same host where your WordPress site lives.

    Using localhost for ANY resource that must be accessed over the network is such a terrible idea, no matter what worked or didn’t work in the past.

    2) Then follow this resource to change the current WordPress site URL to your new one. Note the part about running a search-and-replace on the database to swap old URLs for the new one.

    That’s it.

    Thread Starter ranfur

    (@ranfur)

    @gappiah As I mentioned, I did replace localhost with the local IP address of the machine, now users from the same subject can access the site but if any other uses tries to access it and navigate between pages, when they clicks on a link they get redirected to a subnet that they don’t have access to.

    For example, Alice from the subnet 1.1.1.0 with IP 1.1.1.2 tries to connect to 1.1.1.1 wich is the WordPress site for that subnet. But them Bob from the subnet 1.1.2.0 with IP address 1.1.2.2 tries to connect to 1.1.2.1 which is the address of the server for that subnet, he can navigate the home page but as soon as he navigates to another page using the the link on the menu, he gets redirect to 1.1.1.1, the address for the first subnet and the address that I have set up in setting for WordPress to use.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why is wordpress so picky about the adress you use?’ is closed to new replies.