Skip to main content
paulk7737514
Inspiring
March 2, 2017
Question

Creating a fake host name with XAMPP

  • March 2, 2017
  • 1 reply
  • 3630 views

Does anyone know how to create a fake host name using XAMPP? Usually the site is defined as http://localhost/mydomain/  but I need to do something like this: localhost.mydomain.edu

I am trying to find the file to modify in my XAMPP set up.

    This topic has been closed for replies.

    1 reply

    Nancy OShea
    Community Expert
    Community Expert
    March 2, 2017
    Nancy O'Shea— Product User & Community Expert
    paulk7737514
    Inspiring
    March 2, 2017

    This thread seemed at little confusing as there were errors. I was hoping to find a straightforward solution where nothing was in doubt.

    paulk7737514
    Inspiring
    March 2, 2017

    I don't use XAMPP, but this should work:

    Using Windows file manager, go to C: > Windows > System32 > drivers > etc

    Open hosts and add an entry like 127.0.0.1  mydomainname

    You might have to do this in safe mode

    Then go to your apache directory > conf > extra > httpd-vhosts.conf and add an entry like

    <VirtualHost *:80>
        DocumentRoot "D:/Apache24/htdocs/mydomainname"
        ServerName mydomainname
    </VirtualHost>

    Open httpd.conf in the conf directory and look for #LoadModule vhost_alias_module modules/mod_vhost_alias.so and remove the hash to activate it.

    Next look for #Include conf/extra/httpd-vhosts.conf and remove the hash tag from it.

    Then reboot your computer. Open a browser (not MS Edge) and type http://mydomainname


    Thanks, Rob. One other question: Is localhost.mydomain.edu the same as localhost/mydomain.edu   ?