skip to Main Content

I am trying to create a local domain name for my xampp project

But the dns is not resolving it is not redirecting correctly.

/hosts/etc

127.0.0.1:8081      mydomainname.test

virtualhost

<VirtualHost *:8081>
    DocumentRoot "C:/xampp/htdocs/sam"
    ServerName mydomainname.test
    ServerAlias mydomainname.test
    <Directory "C:/xampp/htdocs/sam">
    Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Allow from all
    Options All
       Require all granted
    </Directory>
</VirtualHost>

2

Answers


  1. Change the file a little

    Listen 8081
    
    <VirtualHost *:8081>
        DocumentRoot "C:/xampp/htdocs/sam"
        ServerName mydomainname.test
        ServerAlias mydomainname.test
        <Directory "C:/xampp/htdocs/sam">
        Options Indexes MultiViews FollowSymLinks
            AllowOverride All
            Order Deny,Allow
            Allow from all
        Options All
           Require all granted
        </Directory>
    </VirtualHost>
    

    Read more here: https://httpd.apache.org/docs/trunk/vhosts/examples.html#port

    Login or Signup to reply.
  2. It’s /etc/hosts. And it does not accept ports and should look like:
    mydomainname.test 127.0.0.1

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search