Apache 虚拟主机总是重定向到/dashboard [英] Apache virtual host always redirecting to /dashboard

查看:41
本文介绍了Apache 虚拟主机总是重定向到/dashboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个看似常见的问题,但我找到的任何解决方案似乎都不适用于我的情况.

I'm having what appears to be a common problem but any solutions I've found don't seem to work for my case.

我正在尝试设置一个虚拟主机,以便我可以通过转到walkpeakdistrict.local"来访问我的 Laravel 安装的公共文件,但是当我在谷歌浏览器中输入这个地址时,我总是被重定向到 xampp 仪表板在这个地址https://walkpeakdistrict.local/dashboard/".

I'm trying to set up a virtual host so that I can access the public file of my Laravel installation by going to "walkpeakdistrict.local" but when I type this address into google chrome I am always redirected to the xampp dashboard at this address "https://walkpeakdistrict.local/dashboard/".

我已将 Laravel 安装在以下 xampp 目录中:c:/xampp/htdocs/walkpeakdistrict_uk.

I've installed Laravel in the following xampp directory: c:/xampp/htdocs/walkpeakdistrict_uk.

我将C:\xampp\apache\conf\extra\httpd-vhosts.conf"设置如下:

I have "C:\xampp\apache\conf\extra\httpd-vhosts.conf" set up as follows:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/walkpeakdistrict_uk/public"
    ServerName walkpeakdistrict.local
</VirtualHost>

我有C:\Windows\System32\drivers\etc\hosts"设置如下:

And I have "C:\Windows\System32\drivers\etc\hosts" set up as follows:

127.0.0.1   localhost
127.0.0.1   walkpeakdistrict.local

如果有人能提供有关此问题的任何见解,我将不胜感激.

If anyone could offer any insight into this issue I would be very grateful.

推荐答案

好吧,我不知道为什么会出现这个问题,但是当我将虚拟主机的服务器名称更改为.local"以外的任何名称时,它似乎可以工作.

Ok, I'm not sure why this was an issue but it seems to work when I change the virtual host's server name to anything other than ".local".

再次感谢所有回复的人!

Thanks again to all who replied!

这篇关于Apache 虚拟主机总是重定向到/dashboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆