简体   繁体   English

尝试访问虚拟主机上的 Laravel 项目时无法检索到请求的 URL

[英]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:我想用 XAMPP 为我的 Laravel 项目创建一个虚拟主机,所以我按照以下步骤操作:

Step 1) C:\\WINDOWS\\system32\\drivers\\etc\\ Opened the "hosts" file (as Administrator):步骤 1) C:\\WINDOWS\\system32\\drivers\\etc\\打开“hosts”文件(以管理员身份):

127.0.0.1       localhost
127.0.0.1       test.com

Step 2) xampp\\apache\\conf\\extra\\httpd-vhosts.conf步骤 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 .步骤 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:向下滚动到最后的Supplemental configuration部分,找到以下部分(大约第 500 行),从第二行的开头删除# ,因此该部分现在看起来像这样:

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

Step 4) Restarted XAMPP and now run this in my browser :第 4 步)重新启动 XAMPP,现在在我的浏览器中运行它:

www.test.com

But now I get this as result:但现在我得到了这个结果:

ERROR The requested URL could not be retrieved错误 无法检索请求的 URL

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?那么如何解决这个问题并在虚拟主机名上运行 Laravel 项目呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试使用 XAMPP 访问虚拟主机上的 Laravel 项目时无法检索请求的 URL - The requested URL could not be retrieved while trying to access Laravel project on Virtual Host with XAMPP 错误:无法检索到所请求的URL - ERROR: The requested URL could not be retrieved 无法检索到请求的URL“ http:// localhost /” <!— ERR_ACCESS_DENIED --> 使用XAMPP - The requested URL could not be retrieved “http://localhost/” <!— ERR_ACCESS_DENIED --> using XAMPP 制作laravel项目的虚拟主机 - make a virtual host of laravel project 为laravel项目创建虚拟主机 - Creating a virtual host for laravel project XAMPP中虚拟主机的问题,基于Laravel的项目 - Problem with Virtual Host in XAMPP, project based on Laravel 未找到 Laravel 虚拟主机请求 URL - Laravel Virtual Host Request Url Not found 尝试加载laravel项目时,如何解决服务器端的“在此服务器上找不到请求的URL /登录”问题? - How to fix, “The requested URL /login was not found on this server” issue on the server end when trying to load a laravel project? laravel - 尝试在 mac 上使用 xampp 设置虚拟主机 - laravel - trying to set up virtual host on using xampp on mac 在Apache虚拟主机上为Laravel项目设置文档根目录 - Setting document root for Laravel project on Apache virtual host
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM