Title: Virtual domain for localhost/wordpress
Last modified: August 21, 2016

---

# Virtual domain for localhost/wordpress

 *  Resolved [Sub_Zero](https://wordpress.org/support/users/sub_zero/)
 * (@sub_zero)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/virtual-domain-for-localhostwordpress/)
 * Hi,
 * I am trying to set a virtual domain on my hosts file. I am using Xampp and this
   is how my line looks like:
 * > 127.0.0.1/wordpress/ mysite
 * The site can’t be found using “mysite” but it works perfectly without /wordpress.
   Then I just get the main page of Xampp.
 * How do make this work for sub folders – in this case for wordpress?

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/virtual-domain-for-localhostwordpress/#post-4444991)
 * See this to set up virtual hosts with xamp:
    [http://ddmboss.wordpress.com/2013/07/10/how-to-set-up-virtual-hosts-using-xampp/](http://ddmboss.wordpress.com/2013/07/10/how-to-set-up-virtual-hosts-using-xampp/)
 * The domain in the hosts file should be a domain similar to this:
 *     ```
       127.0.0.1  mysite.com
       ```
   
 *  Thread Starter [Sub_Zero](https://wordpress.org/support/users/sub_zero/)
 * (@sub_zero)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/virtual-domain-for-localhostwordpress/#post-4445045)
 * I solved it this way:
 * In the hosts file (C:\Windows\System32\drivers\etc):
 * > 127.0.0.1 mysite
 * in the httpd-vhosts.conf (C:\xampp\apache\conf\extra)
 *     ```
       <VirtualHost *:80>
           ServerAdmin myemail@gmail.com
           DocumentRoot "/xampp/htdocs/wordpress"
           ServerName mysite
       </VirtualHost>
       ```
   
 * Just in case somebody is planing to do the same.

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

The topic ‘Virtual domain for localhost/wordpress’ is closed to new replies.

## Tags

 * [hosts](https://wordpress.org/support/topic-tag/hosts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Sub_Zero](https://wordpress.org/support/users/sub_zero/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/virtual-domain-for-localhostwordpress/#post-4445045)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
