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/"
    CustomLog "logs/" common

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             localhost

paste and change to             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