[英]CentOS Apache .htaccess: Options not allowed here (500 - Internal Server Error)
[英]500 Error on apache server - “AllowOverride not allowed here”
我已經在Mac(OSX 10.9)上設置了服務器,但它在錯誤日志中返回500錯誤並顯示以下消息……
[alert] [client ::1] /Users/user/Sites/mysite/.htaccess: AllowOverride not allowed here
這是我的.htaccess文件中的代碼
Options +FollowSymLinks -MultiViews
AllowOverride All
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteMap lc int:toLower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^i/(.*)/(.*)-(.*)$ /items/?id=$1&range=$2&type=$3 [L,QSA,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^c/(.*)$ /category/?menu=$1 [L,QSA,NC]
這是相關的httpd.conf代碼(讓我知道是否還有其他有用的方法)
DocumentRoot "/Users/user/Sites/mysite"
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/Users/user/Sites/mysite">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
有任何想法嗎?
AllowOverride All
不屬於htaccess文件。 在服務器配置(httpd.conf)中使用它來設置htaccess文件可以覆蓋的服務器配置參數。 因此很顯然,能夠配置htaccess文件中哪些參數可以覆蓋htaccess文件是錯誤的。
從您的htaccess文件中刪除它。 您已經在正確的位置httpd.conf中定義了AllowOverride All
。
AllowOverride控制.htaccess-security和-behaviour,因此無法在.htaccess文件中設置。
從.htaccess中刪除“ AllowOverride All”,僅此而已。
從您的.htaccess中刪除AllowOverride All。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.