【发布时间】:2013-07-11 20:37:47
【问题描述】:
我的 htcaccess 文件中有以下内容:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php # Remove .php from filename
RewriteRule ^profiles/([^/]+)\.php profiles.php?id=$1&%{QUERY_STRING} [L] # Pretty url for Profile page
RewriteRule ^crime/([^/]+)\.php crime.php?id=$1&%{QUERY_STRING} [L] # Pretty url for Crime page
RewriteRule ^edit_account/([^/]+)\.php edit_account.php?type=$1&%{QUERY_STRING} [L] # Pretty url for Edit Account Page
到目前为止,.php 部分将从文件中删除,但现在当我尝试使用配置文件页面时,通过以下 url:/profiles/1.php 或 /profiles/1,我得到一个 500 内部服务器错误。文件有什么问题吗?
【问题讨论】:
-
检查你是否安装了 mod_rewrite。还要在 Apache 错误日志中查找错误详细信息
-
@Maks3w mod_rewrite 已安装,在错误日志中我得到:[Sat Jul 13 13:03:09 2013] [error] [client *] Request exceeded the limit of 10 internal redirects due to可能的配置错误。如有必要,使用“LimitInternalRecursion”增加限制。使用'LogLevel debug'获取回溯。,referer:/players_online.php
-
现在我在所有页面上都有一个 500 内部服务器错误。
-
您是否尝试清除缓存
标签: php friendly-url