Htaccess query regarding: application/x-httpd-php

Discussion in 'Apache' started by ian_ok, Feb 8, 2008.

  1. #1
    My server has been upgraded and it's now running on php 4.x and php 5.x

    I use to have the following in my HTACCESS file :
    AddType application/x-httpd-php .php .htm .html
    Code (markup):
    Now I have to use:
    AddType application/x-httpd-php4 .php .htm .html
    Code (markup):
    But can also use:
    <FilesMatch .html>
    SetHandler application/x-httpd-php5
    </FilesMatch>
    Code (markup):
    For each file like .htm do I have to do the same code as above or other?

    Also is this the best way to phase html as php in htaccess or other?

    Thanks Ian
     
    ian_ok, Feb 8, 2008 IP
  2. Cybernaut

    Cybernaut Peon

    Messages:
    408
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Placing "AddType application/x-httpd-php4 .php .htm .html" in your top level htaccess file will do it well. But, it is not the best way of course because each html file will needlessly be parsed by php increasing cpu load. Best is to either use the default .php extension for all php files or something else like .phtml rather than .html or .htm.
     
    Cybernaut, Feb 9, 2008 IP