简体   繁体   中英

The requested URL could not be retrieved while trying to access Laravel project on Virtual Host

I want to create a virtual host for my Laravel project with XAMPP, so I have followed these steps:

Step 1) C:\\WINDOWS\\system32\\drivers\\etc\\ Opened the "hosts" file (as Administrator):

127.0.0.1       localhost
127.0.0.1       test.com

Step 2) xampp\\apache\\conf\\extra\\httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "C:/Users/User 1/Desktop/POUYA/freedeliveries" <= PROJECT DIRECTORY
    ServerName www.test.com
</VirtualHost>

Step 3) C:\\xampp\\apache\\conf\\httpd.conf . Scrolled down to the Supplemental configuration section at the end, and located the following section (around line 500), Removed the # from the beginning of the second line so the section now looks like this:

#Virtual hosts
Include conf/extra/httpd-vhosts.conf

Step 4) Restarted XAMPP and now run this in my browser :

www.test.com

But now I get this as result:

ERROR The requested URL could not be retrieved

The following error was encountered while trying to retrieve the URL: http://test.com/

Unable to determine IP address from hostname test.com

The DNS server returned:

Name Error: The domain name does not exist.
This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.

Your cache administrator is root.

So how to solve this and ran the Laravel project on a virtual hostname?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM