【问题标题】:XAMPP Apache redirect my virtualhost to /dashboardXAMPP Apache 将我的虚拟主机重定向到 /dashboard
【发布时间】: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。

标签: php apache


【解决方案1】:

解决办法是在httpd.conf文件中取消注释这个模块:

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

【讨论】:

    【解决方案2】:

    解决方法是在XAMPP控制面板下重启apache。

    【讨论】:

      猜你喜欢
      • 2017-11-29
      • 2018-07-08
      • 2023-04-06
      • 2016-07-16
      • 2014-01-19
      • 1970-01-01
      • 2014-04-11
      • 1970-01-01
      • 2012-04-02
      相关资源
      最近更新 更多