【发布时间】:2016-03-14 17:48:15
【问题描述】:
当尝试在 XAMPP for Mac OSX 上添加我的 .htaccess 文件时,它会引发错误 500。
我已经尝试将所有 apache 配置文件编辑为“AllowOverride All”,但是无论我做什么,它仍然会引发错误 500。
这是我的 .htaccess:
//Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
//Prevent directory listings
Options All -Indexes
//RewriteEngine
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /b2b/index.php?page=$1&pg=$2&cat=$3 [L]
RewriteRule ^([^/]*)$ /b2b/index.php?page=$1 [L]
</IfModule>
我到处搜索,但似乎找不到有效的解决方案。
【问题讨论】:
-
您将此文件放在结构中的什么位置?
-
给定网站/项目的根目录。应该是这样的:Applications/XAMPP/htdocs/b2b/
-
如果你突然得到一个 http 状态 500,这意味着文件 已 被评估,但包含一个错误,所以崩溃。检查您的 http 服务器错误日志文件,这是特定错误出现的地方。
-
所以没有人可以进入您的网站?
-
即使我只有重写规则或拒绝仅在文件中查看 .htaccess 文件,它也不起作用。无论该文档中有什么内容,都会抛出 500
标签: macos apache .htaccess mod-rewrite xampp