Support » Fixing WordPress » Local Virtual Hosts

  • Hey Everyone,
    So I’m running wordpress locally on Mac OS 10.5.7 for development.
    I often use Virtual Machines (parallels/virtualBox) to run WinXP for testing layout etc. The problem is whenever I view my page from another computer on my network all the external files (js/css) break.

    If I view the source I can obviously see that the url to the documents is still pointing at my localhost.

    I’m using bloginfo(‘template_url’); ?>/c/style.css in my files and http://localhost/~myuser/mysite/wp-content/themes/themename/c/style.css is the resulting output. Shouldn’t the output be reflecting the virtualHost address or remote ip address Im using to connect to the site?

    How can I get around this problem and make my site locally accessible to other unit on my network?


Viewing 3 replies - 1 through 3 (of 3 total)
  • I think there is a solution (I hope to same problem you describe):

    So in my case: I have WIN-XP running inside VirtualBox. Trying to access a WordPress installation outside of the VirtualBox (Ubuntu-Host) by typing inside the WinXP-Browser.

    This of course works fine – accept for the problem you describe: no theme seems to work. In fact, there seem to be many links with “localhost” hard coded in various places within the wordpress installations and add ons.

    1.) I installed xampp in WinXP.

    2.) Added a line to my Win-Hostfile (C:\WINDOWS\system32\drivers\etc\hosts) so that it looks like this: localhost outer

    3.) Simply added a .htaccess file to my … /xampp/htdocs/ directory which contains only this line:
    Redirect / http://outer/

    Now when I enter “localhost” into my WinXP-Browser or whenever the browser comes accross a hard coded localhost-link it correctly maps (rather redirects) all “localhost” requests to “outer” which is resolved as thru the host file.

    Of course I would have liked to simply map localhost to in the host file (which doesn’t work). But hey, the xampp-solution works fine for me.

    Many many MANY thanks to you!

    Been looking for a way to do this for days!

    Was also trying to find a way to simply map in the host file but for a reason I don’t know, that doesn’t work…

    Now, let’s test and debug those websites for IE.. Doh!

    You’re welcome. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Local Virtual Hosts’ is closed to new replies.