skip to Main Content

I am leasing a Unix (Ubuntu) virtual server.

It was recently compromised and so my ISP (WebFusion) removed all my sites and re-installed the server. It is my task to re-build all the websites it contained.

They replaced the old Plesk 9.4 with 11.5, and now I find .htaccess files are ignored, and so I must find another way to direct the server to push .htm files through PHP.

My test for this is done with two files called phpt.php and phpt.htm. Both contain simply

<?php echo "hello" ?>

The .php file works, but the .htm does not.

There is a place in the panels which seems designed to do this. In “Websites & Domains”, if I click “Web Server Settings”, I can see two areas where I can add “Additional directives”.

The comments say I should use httpd.include syntax, and if I research that I see I can say things like “AddHandler cgi-script .cgi”.
So I added “AddHandler php-script .htm” an also “AddHandler php5-script .htm”, saved and restarted the server.

This doesn’t work. Research suggests it’s because nginx is now included with Apache and they interact in such a way as to break this. Great.

So I removed those directives and researched it some more and found this article which says I should make a “conf” directory under the domain root and place a file in it called “vhost.conf” which should contain (for CGI application implementations of PHP like mine):

<Files ~ (.html)>
    SetHandler None
    AddHandler php-script .html
    Options +ExecCGI
    allow from all

I changed this to replace .html with .htm (removing the l) in both locations. I then restarted the server again, but it still doesn’t work.

So at this point I’m at a loss and I would appreciate any help anyone might be able to offer.

Thanks, Chris



  1. Chosen as BEST ANSWER

    Well, this is depressing. All of the stuff I read about nginx not passing directives to Apache is apparently not true. The Parallels article is also un-necessary. Michael - there is no option like the one you mentioned.

    The fields provided by Plesk for "additional directives" DO work, but I had the syntax wrong. I added exactly and only this to the "custom value" for the "Handlers" field:

    php-script .php .htm

    It works. Before I had a variety of erroneous versions of this - sometimes including "AddHandler" sometimes including "php5" and sometimes including multiple lines with different file types.

    But this works. No restart required.

    Thanks for all who tried to help me. I hope this will help others.

    Now on to the next migration nightmare.

  2. I use that in my root .htaccess with Plesk 12.0.18 (also with Apache and nginx):

    AddHandler php-script .htm

    That was ok with Plesk 11 (but not with 9…)

    Login or Signup to reply.
  3. Go to “Web Server Settings” on your domain.

    Try to remove html and htm files from “Serve static files directly by nginx” or disable this setting.

    Web Server Settings

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top