htaccess发生500内部服务器错误

htaccess发生500内部服务器错误

问题描述:

I have files in htm that contain php code and i can run these files by htaccess code. I have done nothing but now suddenly when i am trying to open that page i got 500 Internal Server Error i just remove all the code from htaccess file now it showing all my code in text form.

this is htaccess code

AddHandler application/x-httpd-php5 .htm .php .html
IndexIgnore *
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

why i am getting 500 Internal Server Error when i open my web page but if i just remove this code file code displayed as text.

Please point me in right direction what is wrong with this code

我在 htm code>中有包含php代码的文件,我可以通过htaccess运行这些文件 码。 我什么都没做但现在突然当我试图打开那个页面时我得到 500内部服务器错误 code>我只是从htaccess文件中删除所有代码现在它以文本形式显示我的所有代码。 p >

这是htaccess代码 p>

  AddHandler application / x-httpd-php5 .htm .php .html 
IndexIgnore * 
 nwriteEngine on 
RewriteCond%{  HTTPS}!= on 
RewriteRule(。*)https://%{HTTP_HOST}%{REQUEST_URI} 
  code>  pre> 
 
 

为什么我得到 500 Internal Server 错误 code>当我打开我的网页但如果我只是删除显示为文本的代码文件代码。 p>

请指出我正确的方向此代码有什么问题 p > div>

Most likely you are using PHP as Apache module. In that case have just this one line in root .htaccess:

AddType application/x-httpd-php .htm .html

AddHandler is required when you run PHP as CGI.