Title: Local Virtual Hosts
Last modified: August 19, 2016

---

# Local Virtual Hosts

 *  [brianpearce](https://wordpress.org/support/users/brianpearce/)
 * (@brianpearce)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/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](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?
 * Thanks,
    bp

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [meyway](https://wordpress.org/support/users/meyway/)
 * (@meyway)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/local-virtual-hosts/#post-1089924)
 * 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 10.0.2.2 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.
 * Solution:
    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:
 * 127.0.0.1 localhost
    10.0.2.2 outer
 * 3.) Simply added a .htaccess file to my … /xampp/htdocs/ directory which contains
   only this line:
    Redirect / [http://outer/](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 10.0.2.2 thru the host file.
 * Of course I would have liked to simply map localhost to 10.0.2.2 in the host 
   file (which doesn’t work). But hey, the xampp-solution works fine for me.
 *  [esger](https://wordpress.org/support/users/esger/)
 * (@esger)
 * [16 years ago](https://wordpress.org/support/topic/local-virtual-hosts/#post-1089934)
 * 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!
 *  [meyway](https://wordpress.org/support/users/meyway/)
 * (@meyway)
 * [16 years ago](https://wordpress.org/support/topic/local-virtual-hosts/#post-1089938)
 * You’re welcome. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Local Virtual Hosts’ is closed to new replies.

## Tags

 * [local-host](https://wordpress.org/support/topic-tag/local-host/)
 * [virtualhost](https://wordpress.org/support/topic-tag/virtualhost/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [meyway](https://wordpress.org/support/users/meyway/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/local-virtual-hosts/#post-1089938)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
