1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse .html as PHP stops cutom 404 error page loading in IE

Discussion in 'Apache' started by kurtlane, May 2, 2009.

  1. #1
    Hello,
    I have edited my .htaccess file to point to a custom 404 page by adding

    ErrorDocument 404 /404.html

    Then i wanted to add a little php code to my site, the navigation menu onto every page, so i added a server side include on each .html page.
    Then I researched how to parse .html as php and found i can add

    AddHandler application/x-httpd-php .html .htm
    or
    AddType application/x-httpd-php .html .htm

    It worked, the php appears and i didnt have to rename all my pages .php. Pretty cool, but the custom 404 error page dosent show up in IE8.

    If i remove the above code it works again, put it back and i get the defualt IE8 error page. From my limited testing, on two PC's, XP and Vista, and 5 different browsers IE6 & IE8 are affected. Google Chrome, Safari, and Firefox are not affected.

    I also use in the .htaccess file
    ErrorDocument 403 /403.html
    Options -Indexes

    And when a browser tries to browse directories it takes them to my custom 403 error page that says forbidden. That function is not affected.

    Hope you can help. Thank you in advance.
     
    kurtlane, May 2, 2009 IP
  2. SSANZ

    SSANZ Peon

    Messages:
    861
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In all honesty, forget about IE - Yes there may still be a lot of IE users, however they are getting infected slowly :p

    Put a note on the page - not compatible with IE.

    :)
     
    SSANZ, May 2, 2009 IP
  3. kurtlane

    kurtlane Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3


    Thanks but thats not the answer im looking for. When a potential customer on my site reaches a page that dosent exist, I want them to reach a custom 404 error page. Thanks for your time.

    Hope someone with Apache skills can help.

    Kurt.
     
    kurtlane, May 2, 2009 IP
  4. kurtlane

    kurtlane Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I did this to fix it, If anyone has a better idea and explaination please let me know.

    In the .htaccess file I changed the application/x-httpd-php line to only work for .html. Then i changed the name of the error document to 404.htm.

    ErrorDocument 404 /404.htm
    AddType application/x-httpd-php .html

    It is working.
     
    kurtlane, May 2, 2009 IP