2015-08-14 124 views
1

在运行XAMPP的Windows机器上,我的web根目录中有一个名为'static'的文件夹。即使文件夹在那里,它和其中的所有内容都会返回404错误。Directory'static'给404错误

static directory

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

该网站是我们的一台Linux服务器上的其中一个网站的副本。我可以做什么或更改以允许该目录按指定方式工作?

编辑 vhosts.conf

<VirtualHost *:8080> 
    ServerAdmin [email protected] 
    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> 
+0

该文件夹的完整路径是什么?静态 –

+0

你的apache配置中没有对/ static进行特殊处理? – covener

+0

你能向我们展示你的虚拟主机吗? – Sculper

回答

1

我正准备重新安装XAMPP而是通过对Apache的配置文件进行最后一次通。我发现这个问题是这段代码在httpd.conf文件 -

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

我不知道这是否是XAMPP安装的一部分,因为所有我对这个过程做出的修改都在虚拟主机文件。一旦注释掉静态目录,就像我已经定义的那样,现在可以正常工作。