【问题标题】:Vhost works in Chrome but not in firefox? (XAMPP)Vhost 在 Chrome 中工作,但在 Firefox 中不工作? (XAMPP)
【发布时间】:2021-01-10 16:15:41
【问题描述】:

我的虚拟主机配置似乎在 Chrome 中有效,但在 Firefox 中无效?

127.0.0.1 dev.test.local

<VirtualHost *:80>
    DocumentRoot "D:\xampp\htdocs\12345-test\public"
    ServerName dev.test.local
    ServerAlias dev.test.local
    <Directory "D:\xampp\htdocs\12345-test\public">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Chrome 结果:可达

Firefox 结果:显示/的索引

重新启动 XAMPP 并在 Firefox 上转到我的域不起作用,如果我在 Chrome 中打开它,它可以工作,然后也开始在 Firefox 中工作?呵呵?

【问题讨论】:

  • 当您加载/ 时,Firefox 会显示目录索引而 Chrome 不会?这就是Options Indexes 的含义,所以我猜Chrome 做错了什么。 Chrome 显示什么?你在期待什么?
  • Chrome 按我的预期显示后端页面,但 Firefox 显示索引。奇怪的是我在我的另一台电脑上安装了这个设置(我的意思是虚拟主机)并且只在那里使用 Chrome,但它根本不起作用......这只是一个 laravel 项目我已经检查了 index.php 和它看起来很好,当显示索引时它显然没有达到它
  • 那么你想加载index.php。您共享的设置中没有任何内容专门配置它。也许您之前有过,Chrome 显示的是缓存版本。您需要添加DirectoryIndex index.php
  • 当然可以,但它不应该已经在 Apache 中的 DirectoryIndex index.php 中指定了吗?因为它是。
  • 我不知道,你才第一次提到。 mod_dir 本身是否启用?您是否清除了 Firefox 缓存?

标签: apache xampp vhosts


【解决方案1】:

我遇到了同样的错误,终于找到了这个解决方案

xampp vhost设置后,需要system32 localhost url注册。

请检查此网址。

https://www.cloudways.com/blog/configure-virtual-host-on-windows-10-for-wordpress/

有时,由于未经许可,您无法编辑系统文件。

在这种情况下,请检查此网址。

https://www.partitionwizard.com/partitionmagic/you-dont-have-permission-to-save-in-this-location.html

此网址说明了如何将系统上特定文件夹的完全控制权授予管理员。

【讨论】:

    猜你喜欢
    • 2016-04-18
    • 2017-05-10
    • 2021-08-12
    • 2016-07-19
    • 2017-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多