2015-08-14 85 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安裝的一部分,因爲所有我對這個過程做出的修改都在虛擬主機文件。一旦註釋掉靜態目錄,就像我已經定義的那樣,現在可以正常工作。