【发布时间】:2016-03-26 08:23:56
【问题描述】:
我在 Mac 上的 XAMPP 中配置我的 apache 主机名和虚拟主机。
但是,当我访问主机 url 时,xampp 会将我重定向到 /dashboard: mydomain.dev/dashboard
这是我的 httpd-vhosts.conf:
# Virtual Hosts
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/web_frikinow/public"
ServerName mydomain.dev
</VirtualHost>
这是我的 /etc/hosts 文件:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 mydomain.dev
127.0.0.1 Funny-Frontend # added by Apache Friends XAMPP
有什么问题?
【问题讨论】:
-
该死,我在本地网络上使用了类似的逻辑 - 包括“个人域名” - “因为我们可以。嗯,看起来还可以。为“索引”文件添加一个条目?即 index.php index.html 等?您在该目录中有哪些文件? Web 服务器用户可以访问该目录吗?
-
DocumentRoot 中有脚本吗?
-
Ryan Vincent 我为我的文件启用了所有权限 777...
-
我不明白,
代码在哪里? -
适用于此处的示例条目Pastebin - Example virtual host。这些条目必须在您的“主机”文件中——您已经知道了。可悲的是,我在 Windows 上使用 XAMPP。