我剛剛在家用電腦上安裝了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的該項目,將不勝感激
不要把網站放入網站。你只會遇到可能的配置問題和其他.htaccess的影響。 –
@CharlotteDunois你能舉一個例子來說明怎麼做? – jkushner
@CharlotteDunois我添加了錯誤日誌 – jkushner