Results 1 to 2 of 2
  1. #1

    Default AddHandler application/x-httpd-php .html .htm tries to download the file

    I'm having problem configuring the server through .htaccess. It was working fine until I added the line
    Code:
    AddType application/x-httpd-php .html .htm
    So that .html files could have PHP includes in them for cross-site consistency. Now whenever I try to open the page, it tells me I'm trying to download the HTML file.

    Can anyone help with this?

    EDIT: Sorry, title should have said AddType, not AddHandler. After using Google, I tried it with AddHandler, but the result was that it didn't try to download the file, but it didn't process it as PHP either.
    Last edited by heroofcamelot; 03-02-2013 at 02:15 PM.

  2. #2

    Default

    Figured out the problem. I'll post the solution in case anyone has this problem in the future.

    I was trying to force HTML files to be parsed as PHP, but I didn't realize that Server Side Includes were enabled in the httpd.conf file. I had to find the line
    Code:
    AddHandler server-parsed .shtml .html .htm
    And comment it out, then restart the server.

    That line appears more than once in the httpd.conf file, actually. You have to find the one that's near this section:
    Code:
     AddType application/x-httpd-php .php .php4 .php3 .phtml                 
            AddType application/x-httpd-php-source .phps                            
                                                                                    
                                                                                    
            AddType application/x-httpd-php3 .php3                                  
            AddType application/x-httpd-php3-source .phps                           
                                                                                    
                                                                                    
            AddType application/x-httpd-php .phtml                                  
                                                                                    
        AddType text/html .shtml                                                    
        AddHandler server-parsed .shtml .html .htm

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •