Skillbooker
Login Register

How To Setup Spesific Local Domain ( Virtual Hosts ) Using XAMPP on Windows

Here is some instruction how to setup a spesific domain name on Xampp using a Windows 7 machine. Routes might change contact us if you stuggle.

First make sure you have downloaded and installed Xampp

Take Notepad or your favourite IDE and go to  C:/xampp/apache/conf/extra/httpd-vhosts.conf
Open this file and at the bottom of this file paste:

<VirtualHost *:80>
    ServerAdmin my-new-domain
    DocumentRoot "C:/xampp/htdocs/my-new-domain"
    ServerName my-new-domain
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

Now in your 'start' button, right click right on Notepad, select 'run as administrator', in Notepad go File->Open navigate to C:/Windows/System32/drivers/etc/hosts open up hosts

Copy the line 
127.0.0.1             localhost

paste and change to 

127.0.0.1             my-new-domain

(add as many as you like or have defined in your apache vhost file)

Restart Apache 

Voila ! Happy days



Posted on: 2016-11-18 Please login/register to leave comments