我必须通过.htaccess文件传递一个查询字符串变量“_page”,这会导致505(内部服务器)错误。505错误在.htaccess文件中传递查询字符串变量
这是我的.htaccess文件:
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Make sure that there is ALWAYS a querystring variable named "__page"
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(php|xml))$ $1?__page=$1 [L,QSA]
#Append ".php" to the requested file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php?__page=$1.php [L,QSA]
</IfModule>
当我发表意见线
#RewriteRule ^(.*\.(php|xml))$ $1?__page=$1 [L,QSA]
在.htaccess文件
,505云,但它显示一个警告 “未定义指数:__page”
'“_page”'不等于'__page' –
由具有内部服务器错误,看看你的服务器的错误日志。应该记录一个特定的错误信息。 – KittMedia
@Anant它的“__page”,这是错误的描述 – satish