Results 1 to 4 of 4

Thread: mime types

  1. #1
    andychev's Avatar
    andychev is offline Master Glow Jedi
    Join Date
    Apr 2005
    Location
    Chester, UK
    Posts
    150

    Default mime types

    This should be a straight forward problem but it is driving me mad trying to get it to work!

    What im trying to do:
    I have a file - index.html which contains php code but i want it to appear to be a html file. Straight forward enough.

    There for in .htaccess i have put in the following code
    AddType application/x-httpd-php .html

    which should map the html file on the php application, right?

    However all i get is a 500 internal server error.

    The file in question runs fine with a .php extension.

    Help!

  2. #2
    sergey is offline Master Glow Jedi
    Join Date
    Aug 2005
    Posts
    472

    Default

    AddType directive works only with PHP compiled as Apache module. Since we are running PHPSuExec on our servers you will need to use AddHandler directive to get php code working in .html files :

    AddHandler application/x-httpd-php .html

  3. #3
    andychev's Avatar
    andychev is offline Master Glow Jedi
    Join Date
    Apr 2005
    Location
    Chester, UK
    Posts
    150

    Default

    Excellent, All sorted.

    Thank you!

  4. #4
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,236

    Default

    Just a side note that on the newer (and soon to be deprecated) Apache builds where you have the option to select php4 or php5 you will want to modify the above suggestion to this:

    AddHandler application/x-httpd-php5 .html .htm .php

    or

    AddHandler application/x-httpd-php4 .html .htm .php

    Depending on the version of php that you are running. You can configure this in your cPanel > PHP Configuration.

    Remember PHP4 will soon be dead so we recommend selecting PHP5.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14