【发布时间】:2013-07-04 04:08:24
【问题描述】:
我将当前的 .htaccess 文件上传到 1and1 服务器(实际上是 1und1.de,但我猜是一样的),我收到 500 Internal Server Error。
Options -MultiViews
RewriteEngine On
RewriteBase /lammkontor
RewriteRule ^categories/([^/\.]+)/?$ index.php?url=category.php&cat_url=$1 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/?$ index.php?url=product.php&cat_url=$1&prod_url=$2 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/recipes?$ index.php?url=recipes.php&cat_url=$1&prod_url=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]
这个 .htaccess 在我的本地 MAMP 服务器上完美运行。
当我使用示例文件在控制中心测试 CGI-Monitor 时,我得到
- cgi: File not present or has invalid modes
(no output)
现在唯一工作的文件是 index.php
感谢您的帮助!
【问题讨论】:
-
查看你的 apache 日志,它通常会告诉你更多关于为什么会出现 500 错误的细节。
-
1.通过访问文件 url 确保文件确实存在。 2. 确保文件具有正确的权限。如果 1 有效,那么 2 应该没问题。
-
尝试删除
Options -MultiViews,看看你是否仍然得到500错误,然后它没有得到500,你的httpd.conf中可能存在配置差异 -
RewriteBase /lammkontor ?您的测试站点在此子文件夹中?
标签: apache .htaccess mod-rewrite rewrite