【发布时间】:2015-11-08 05:56:10
【问题描述】:
在运行 XAMPP 的 Windows 机器上,我的 Web 根目录中有一个名为“static”的文件夹。即使文件夹存在,它和其中的所有内容都会返回 404 错误。
如果我更改文件夹的名称,例如'静态',一切都很好。我有其他运行 Apache 的服务器 (Ubuntu),我没有这个问题。
该站点是我们的一台 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/$2
<Directory /home/src/gateway/webui>
DirectoryIndex home.html
Options All
AllowOverride All
Require all granted
</Directory>
【问题讨论】:
-
文件夹的完整路径是什么?静态的
-
在您的 apache 配置中没有对 /static 进行特殊处理?
-
你能告诉我们你的虚拟主机吗?
-
我已经添加了虚拟主机文件@Sculper