2016-01-21 61 views
2

我剛剛在家用電腦上安裝了ubuntu作爲雙啓動。Apache不加載htaccess,但仍然重寫

我有以下路徑htaccess的:

/var/www/html/cortana/html/.htaccess 

我使用的是標準的Apache服務器版本現在2.4

我的Zend框架的項目坐落在:

/var/www/html/cortana/html/index.php 

我們通過瀏覽器中的http://localhost/cortana/html/index.php訪問它。

這是我目前的.htaccess

SetEnv APPLICATION_ENV development 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L] 

現在,當我去index.php並鍵入<?php echo getenv('APPLICATION_ENV');die()?> 我沒有得到任何迴應

而且,這裏是錯誤日誌:

[Thu Jan 21 03:00:06.542376 2016] [authz_core:error] [pid 5262] [client 127.0.0.1:52981] AH01630: client denied by server configuration: /var/www/html/cortana/html/.htaccess 

然而,它實際上是使用mod重寫模塊,因爲它的處理應用程序中的重定向。另外,如果我完全刪除項目HTML目錄中的htaccess它仍然有效

我認爲這可能是一個Apache配置問題,因爲使用/var/www/html根路徑中的項目。

任何幫助,爲什麼它不使用隨機提供的htaccess的該項目,將不勝感激

+0

不要把網站放入網站。你只會遇到可能的配置問題和其他.htaccess的影響。 –

+0

@CharlotteDunois你能舉一個例子來說明怎麼做? – jkushner

+0

@CharlotteDunois我添加了錯誤日誌 – jkushner

回答

0

試着在你.htaccess文件的頂部使用此代碼:

order deny,allow 
allow from all 

如果它仍然無法正常工作,請通過.htaccess文件在您項目的根目錄下。

編輯:

或者在你的virtualhost配置您可以添加Require all granted。看看this related question