AddType in htaccess causes page to download

前端 未结 9 1997
走了就别回头了
走了就别回头了 2020-12-16 18:34

I have read about 10 questions like this, but there seems to be no answer to this simple question.

What could cause .htm files to be downloading instead of executed

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 18:58

    I had the same problem and couldn't find the answer here. Did find it on this cpanel forum though: https://forums.cpanel.net/threads/php-script-is-not-working-in-html-file.595195/

    Their advice was to use this:

    AddHandler application/x-httpd-ea-php56 .htm .html .shtml
    AddType application/x-httpd-php5 .php
    

    I was using PHP together with JSON though. After this PHP did work, but JSON didn't. Solved it by removing the AddType and sticking with the AddHandler

    AddHandler application/x-httpd-ea-php56 .htm .html .shtml
    

提交回复
热议问题