WordPress.org

Forums

[resolved] wp development thru wifi not serving anything localhost referenced (9 posts)

  1. thefeldkircher
    Member
    Posted 10 months ago #

    This is a new one on me. I am currently developing a new wordpress site for mobile. When I connect my devices via wifi and enter 192.168.1.x/wp_theme_builder which is the root of my wp install, I get everything except styles, scripts and images.

    I have narrowed this down to network net::ERR_CONNECTION_REFUSED errors reported in Google Developer Tools via usb debugging.

    Any script, style or image referenced by bloginfo('template_directory') for example, resolves to

    http://localhost/wp_theme_builder/..........

    Therefore localhost is being denied when connected thru 192.168.1.x, anybody know how to fix this.

    Thanks

  2. esmi
    Forum Moderator
    Posted 10 months ago #

    You cannot use localhost as part of your site url if you want to be able to access the site from other computers in your local network. Every computer defines itself as localhost. You need to use an internal domain name. See Changing_The_Site_URL for details of how to change the site urls correctly.

  3. thefeldkircher
    Member
    Posted 10 months ago #

    Hi esmi

    Thanks for the info, I changed both urls by using the functions.php method. Complete meltdown, desktop now has the same problem. Also couldn't login, changed back to original urls.

    I am not really sure what I'm supposed to name them given that I have wp installed in my htdocs folder on my local dev machine. I will still have to connect using localhost/whatever/ which is served by xampp.

    Regards

  4. esmi
    Forum Moderator
    Posted 10 months ago #

  5. thefeldkircher
    Member
    Posted 10 months ago #

    Yes I did, I have renamed the urls with variations of my wp install name:
    wp_theme_builder with and without localhost in the url.

    I am not trying to move the install, I am trying to test my site on android devices to see how they function and look with respect to the desktop version before release.

  6. thefeldkircher
    Member
    Posted 10 months ago #

    Perhaps you could try to recreate my situation.

    Connect an android device to your wifi, open a browser enter 192.168.1.4/path_to_a_wordpress_install in the address bar and see what gets returned. I get everything except those served from localhost such as images, styles and scripts.

    Thanks

  7. thefeldkircher
    Member
    Posted 10 months ago #

    OK I have renamed localhost to dev.com in my hosts file, now both my wp url's read

    'http://dev.com/wp_theme_builder'

    But the problem remains when accessing via wifi on 192.168.1.4/wp_theme_builder

    This is bizzare!

  8. thefeldkircher
    Member
    Posted 10 months ago #

    OK the saga continues.

    As I said in a previous post I have renamed my localhost to dev.com I now access wp via wifi in a browser using 192.168.1.x/wp_theme_builder I still don't get scripts, images and styles but now they are listed as 404's and not err_connection_refused.

    Anybody have any idea how to fix this?

    Regards

  9. thefeldkircher
    Member
    Posted 10 months ago #

    OK I have found a solution, I am posting this here for anybody else who wishes to test wp via subnet wifi.

    Follow the instructions here

    Doesn't matter which localhost your running just follow the instructions at the end for wordpress.

    My site now runs on all my devices, Nice.

    Regards

Reply

You must log in to post.

About this Topic