.htaccess内部服务器错误问题

时间:2015-04-13 15:55:50

标签: apache .htaccess

我尝试打开网站时遇到内部服务器错误(http://olikez.cf/)。

下面是我的.htaccess文件中的一些行,当我删除它们的网站工作但有一些脚本错误。

行:

php_flag display_errors 0
php_value error_reporting 7
php_value register_globals 0
php_flag session.use_trans_sid off
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value magic_quotes_sybase 0
php_value allow_url_fopen 0
php_value arg_separator.output "&"

下面我分享了完整的.htaccess文件

Options -Indexes
ErrorDocument 402 http://yoursite.com/?err&404
ErrorDocument 403 http://yoursite.com/?err&403
ErrorDocument 404 http://yoursite.com/?err&404
ErrorDocument 500 http://yoursite.com/?err&500
DirectoryIndex index.php

RemoveHandler .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
AddType application/x-httpd-php-source .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py

php_flag display_errors 0
php_value error_reporting 7
php_value register_globals 0
php_flag session.use_trans_sid off
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value magic_quotes_sybase 0
php_value allow_url_fopen 0
php_value arg_separator.output "&"
AddDefaultCharset UTF-8

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A1209600
  <FilesMatch \.php$>
    ExpiresActive Off
  </FilesMatch>
</IfModule>

RewriteEngine On
RewriteBase /

RewriteRule ^site/([a-z0-9-_\/]+)\.([a-z0-9]{2,4}+)$ index.php?routes=/__site/true/act/site/$1.$2 [L,QSA]
RewriteRule ^site/([a-z0-9-_\/]+)$ index.php?routes=/__site/true/act/site/$1/index.html [L,QSA]
RewriteRule ^site$ /site/index.html [R]
RewriteRule ^site/$ /site/index.html [R]
RewriteRule ^page/([0-9]+)\.html$ index.php?routes=/__site/true/act/index/page/$1 [L,QSA]
RewriteRule ^(home|index)\.html$ index.php?routes=/__site/true/act/index [L,QSA]
RewriteRule ^captcha\.png$ captcha.php [L,QSA]
RewriteRule ^category/([a-z0-9-]+)/([0-9]+)\.html$ index.php?routes=/__site/true/act/category/category/$1/page/$2 [L,QSA]
RewriteRule ^tag/([a-z0-9-]+)/([0-9]+)\.html$ index.php?routes=/__site/true/act/tag/tag/$1/page/$2 [L,QSA]
RewriteRule ^([a-z0-9-]+)\.html$ index.php?routes=/__site/true/act/read/post/$1 [L,QSA]
RewriteRule ^content/([a-z0-9-]{1,30}+)\.([a-z0-9]{2,4}+)$ index.php?routes=/__site/true/act/content/filename/$1/fileext/$2 [L,QSA]
RewriteRule ^rss\.xml$ index.php?routes=/__site/true/act/rss [L,QSA]
RewriteRule ^comment/rss\.xml$ index.php?routes=/__site/true/act/rss/mod/comments [L,QSA]
RewriteRule ^([a-z0-9-]+)/rss\.xml$ index.php?routes=/__site/true/act/rss/mod/post_comments/permalink/$1 [L,QSA]
RewriteRule ^userlogin$ login.php?routes=/__site/true/ [L,QSA]
RewriteRule ^usersignout$ index.php?routes=/__site/true/act/usersignout [L,QSA]

RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
RewriteRule .* - [F]

1 个答案:

答案 0 :(得分:1)

你应该使用开/关来表示php_flag,而不是0.它与php函数display_errors(0)不同。替换为:

 php_flag display_errors Off

检查服务器上是否有 index.php 文件。