Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php SEO友好URL 500服务器错误_Php_Friendly Url - Fatal编程技术网

Php SEO友好URL 500服务器错误

Php SEO友好URL 500服务器错误,php,friendly-url,Php,Friendly Url,我的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.

我的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内部服务器错误。文件中是否有任何错误?

如果您在远程服务器上托管此网站,请询问他们是否被阻止。htaccess。这发生在我身上,服务器管理员在未通知的情况下停止了.htaccess

一旦编写了删除扩展名的规则,就不需要编写
.php

RewriteRule ^profiles/([^/]+) profiles.php?id=$1&%{QUERY_STRING} [L] #without .php

检查是否已安装mod_rewrite。还要在Apache错误中查找错误详细信息log@Maks3w由于可能的配置错误,在我得到的错误日志中安装了mod_重写:[Sat Jul 13:03:09 2013][error][client*]请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯,referer:/players\u online.phpNow我在所有页面上都有一个500内部服务器错误。您是否尝试清除缓存当我在htaccess中有此错误时它工作了:RewriteRule^profiles/([^/]+)\.php profiles.php?id=$1&%%{QUERY STRING}[L]RewriteRule^crime/([^/]+)\.php?id=$1&%{QUERY STRING}[L]重写规则^edit\u account/([^/]+)\.php edit\u account.php?type=$1&%{QUERY\u STRING}[L],并认为删除所有文件的.php扩展名也可以删除,但在我这样做之后,它停止工作。