我遇到了一個網站問題,它看起來像我的htaccess文件(位於web根目錄)阻止訪問子目錄中的任何php文件。我已經通過創建一個新的測試文件夾並添加了一個php文件來測試這個文件,它做了一個簡單的回聲。我總是得到500錯誤。PHP Kohana。 Htaccess似乎阻止了對子文件夾的訪問。
此問題最近纔開始發生。我擁有的htaccess規則與我在自己的服務器上運行的許多其他網站相同,但是這一個網站由不同的公司託管。有誰知道爲什麼會發生這種情況?服務器上的更改是否可能導致了這種情況?
這是我的htaccess文件:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
# Turn on URL rewriting
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/kohana/, use /kohana/
# If your URL is www.example.com/, use/
RewriteBase/
# Protect application and system files from being viewed
RewriteCond $1 ^(app_admin|app_public|system)
# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
# Do not enable rewriting for other files that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
Options -Indexes
你的Apache錯誤日誌說什麼?如果你得到一個500錯誤,Apache總是會記錄一條消息告訴你問題是什麼...... – DaveRandom
@Dave - 我得到'pcfg_openfile:無法檢查htaccess文件,確保它是可讀的 - 但是,htaccess是可讀和可執行的它擁有755個權限。 – user1153594
檢查文件的代碼頁,您的編輯器可能已將其轉換爲Apache不喜歡的某種多字節字符集?該錯誤表明權限無效,因此三重檢查權限,可能是chown' /'chgrp'到Web服務器用戶,並檢查目錄層次結構的權限。 – DaveRandom