dou44364983
2015-01-08 20:45
浏览 75
已采纳

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

图片转代码服务由CSDN问答提供 功能建议

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

这是htaccess代码

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

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

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

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dtvfxzq3802 2015-01-09 09:01
    最佳回答

    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.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题