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.

PHP AddHandler Blocking Another AddHandler

Discussion in 'PHP' started by sport302, Oct 24, 2015.

  1. #1
    Hello,

    I am trying to run a PHP script on an html page and I have figured out that I need to add the following to my htaccess file:

    AddHandler application/x-httpd-php .html

    So I did that and it allowed the PHP script to run as needed, but it also blocked another AddHandler from running, which I use for html include files such as sitewide navigation and ads.

    This is what my htaccess file looks like:

    Options +Includes
    AddHandler server-parsed .html

    AddHandler application/x-httpd-php .html


    For whatever reason the Options +Includes AddHandler gets blocked when I add the PHP AddHandler, which means the sitewide include files do not display as they usually do.

    Is there a way to have both AddHandler commands running without one blocking the other?

    Thanks for any help...
     
    sport302, Oct 24, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    While I can't quite say what's making it behave in the "undesired" manner since it sounds like it's behaving exactly as you have it written -- only the latter of those two declarations should work given they have the same TARGET (.html)

    But that said I wonder why the **** (no offense) you would make ALL HTML files run through the PHP parser. Just bound and determined to make the server work twice as hard on static files that should NEVER be processed by the parser?

    I'd say the problem isn't with how you're doing it, but with what you are trying to do in the first place; something goofy that shouldn't EVER be done.
     
    deathshadow, Oct 25, 2015 IP