0

I set up a virtual host for my laravel project, and while I can access the site via IP I cannot access it by domain name (it redirects me to WAMPserver's homepage). For reference I'll provide both relevant screenshots and code excerpts:

httpd-vhosts.conf File

#Dragon's Lair Laravel Project
<VirtualHost 127.27.18.28:80>
    ServerName dragonslair.test
    DocumentRoot "c:/laravelprojects/dragonslair/public"
    <Directory  "c:/laravelprojects/dragonslair/public/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>   

enter image description here

hosts File

#
127.0.0.1 localhost
::1 localhost
192.168.10.10 dummyRegistration.test

127.27.18.28 dragonslair.test
::1 dragonslair.test   

enter image description here

IP Address Resolves Properly

enter image description here

Domain Name Redirect

enter image description here

I would presumably create many virtual hosts in future, and don't want to start having to memorise their IP addresses, which is why I want to get the DNS working properly.

  • Do you have resolv for hostname dragonslair.test? – Romeo Ninov Jan 11 at 9:21
  • "resolv"? I am not sure what you're referring to @RomeoNinov. – Tobi Alafin Jan 11 at 9:30
  • what is the result of nslookup dragonslair.test? If you have no output you should set it (possible in hosts file) – Romeo Ninov Jan 11 at 9:32
  • @RomeoNinov here's the output of nslookup: i.imgur.com/cxMD67L.png. Apparently, "dragonslair.test" is not set. I am not sure how to set it, I provided an example of my hosts file, and I'm not sure what I'm doing wrong. – Tobi Alafin Jan 11 at 9:36
  • In hosts file add line like: 127.27.18.28 dragonslair.test – Romeo Ninov Jan 11 at 9:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.