[resolved] Localhost URL's Not Resolving On Local Development Network (3 posts)

  1. Buzzingrobot
    Posted 4 years ago #

    I have a two-machine little wireless net at home. A Windows machine serves as a WP development server. When accessed from the other machine, a Mac, CSS,images, etc., are not found.

    I assume this has to do with the fact that the refs to such things are absolute paths to files on the Windows machine, which are appearing as: "http://localhost/wordpress/......./style.css" .

    Obviously, "localhost" is the Windows machine, and URLs like that aren't resolving on the Mac (which is its own local host).

    Things work if I hardcode IP-based URLs into the WP code.. But, there must be a better way. How can fix this?

  2. Buzzingrobot
    Posted 4 years ago #

    OK, I can answer myself. In Settings, I replaced "localhost" with the IP address of the machine hosting WP in both the "WordPress address" and "Site address" entries. Now, all the ref's are generated with the IP.

  3. Alternatively, consider using a local naming scheme. *.local is popular sometimes.

    To do this, edit your HOSTS file on both machines. On Windows it'll be C:\Windows\System32\drivers\etc\hosts and on a Mac it'll be in /etc/hosts or /private/etc/hosts or you might have to use some weird Mac specific thing (I don't use Macs).

    Anyway, then just give the computers local names and set their IPs accordingly in the hosts files and you can then reference them by name. bob.local or bill.local and so on. :)

Topic Closed

This topic has been closed to new replies.

About this Topic