我有一個htaccess的問題。Apache .htaccess
我的目錄結構是這樣的:
/
HEADER.html
README.html
/stackoverflow/
/stackoverflow/.htaccess
的.htaccess
ServerSignature Off
Options +Indexes
HeaderName /HEADER.html
IndexIgnore HEADER.html
ReadmeName /README.html
IndexIgnore /README.html
IndexOptions +FancyIndexing
AddCharset UTF-8 .txt
IndexIgnore *.xml
IndexIgnore *.php
我的主要目錄是/計算器/,當我通過瀏覽器瀏覽到該目錄我已經包含了header.html和README.html在/ stackoverflow /下的每個站點/目錄下,這工作正常。
我添加了一些PHP代碼我header.html中(這是在根目錄/),我嘗試添加到htaccess的:
將AddType應用/ X的httpd - PHP的.html .PHP的.htm
這不工作,我想是因爲HEADER.html是在根。
如果我嘗試將AddType ...添加到/.htaccess(而不是/stackoverflow/.htaccess),它將覆蓋我的/stackoverflow/.htaccess規則。爲什麼?如何將AddType規則添加到我的/stackoverflow/.htaccess中,以便將Apache文件解析爲php文件?