• I have a webserver running from my computer and was wondering if I could access WordPress from both my computer and computers outside from my IP?

    Thanks
    PS: I’ve tried entering ‘../’ and ‘../blog’ (the folder WP is installed in) for both WordPress and Blog URIs (I don’t know the difference between the two..) and vice-versa and both ‘../’ and both ‘../blog’. Nothing seems to work

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • You probably need to try something along these lines assuming that the machine you call localhost is behind a firewall and web requests are forwarded to localhost by the firewall.

    Set up WordPress as if hosted on the domainname. Therefore if your domainname was www.example.com and your WordPress install was in /blog/ you would enter the following values in the WordPress admin user-interface:

    This should then means that as long as www.example.com points at your firewall and your firewall passes traffic for port 80 to localhost and the webserver on localhost is setup to be www.example.com your blog will be accessible from the domain name.

    The next step is to make it available for you to work on locally as well. Once setup as detailed above it is likely that access via the domain name won’t work when you are on a machine behind the firewall so what you need to do is tell the machine localhost the IP address for the domain www.example.com that you would like it to use instead of the one that everyone else uses.

    This is achieved by adding an entry to the /etc/hosts file (on Linux) or the C:\windows\system32\drivers\etc\hosts file (On Windows XP). If you add the following line to the relevant one of those files on localhost then you should be able to access the blog by the url https://www.example.com/blog/ while you are on the machine localhost:

    127.0.0.1 localhost www.example.com

    If a line which starts with 127.0.0.1 already exists then add the www.example.com onto the end on the list of hostnames on that line.

    hope this helps.

    Thread Starter wuzzie

    (@wuzzie)

    OMG
    THAT MOST DEFINITELY HELPS!
    especially the last part, about adding an entry

    If I were a girl, I will kiss you :]

    Has any thought been given to allowing administrators to specify relative paths for the WordPress and Blog addresses? This would solve the problem discussed above without requiring the workaround of using a hosts file.

    The hosts file solution is very inconvenient for me, since I have a laptop that must be able to access the site from both internal and external networks. Are there any workarounds that would address this situation?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘access WP from localhost AND domain’ is closed to new replies.