目录 'static' 给出 404 错误

Directory 'static' gives 404 error

在 Windows 机器上 运行 XAMPP 我的网络根目录中有一个名为 'static' 的文件夹。它和其中的所有内容 return 一个 404 错误,即使文件夹在那里。

如果我更改文件夹的名称,例如'statics',一切顺利。我有其他服务器 (Ubuntu) 运行 Apache,我没有这个问题。

该站点是我们 Linux 服务器之一上的其中一个站点的副本。我可以做什么或更改以允许目录按命名工作?

编辑 vhosts.conf

<VirtualHost *:8080>
    ServerAdmin jablanchard@foo.com
    DocumentRoot "C:/xampp/htdocs/home/app/gateway"
    ServerName localhost
    ServerAlias 127.0.0.*
    ErrorLog "logs/error.log"
    CustomLog "logs/access.log" common
</VirtualHost>

<Directory C:/xampp/htdocs/home/app/gateway/>
    # allow .htaccess overrides to work
    AllowOverride All
    DirectoryIndex login.html index.html index.php
</Directory>

# this matches a link to any project directory to the physical webui directory
AliasMatch ^/projects/([-\w]*)/(.*)$ /home/src/gateway/webui/
<Directory /home/src/gateway/webui>
    DirectoryIndex home.html
    Options All
    AllowOverride All
    Require all granted
</Directory>

我正准备重新安装 XAMPP 但最后一次检查了 Apache 的配置文件。我发现问题出在 httpd.conf 文件中的这段代码 -

Alias "/static" "C:/xampp/htdocs/static"
<Directory "C:/xampp/htdocs/static">
    AllowOverride All
    Require all granted
</Directory>

我不确定这是否是 XAMPP 安装的一部分,因为我对此安装所做的所有编辑都在 vhosts 文件中。注释掉我定义的静态目录后,现在可以正常工作了。