setting ext-app for just one subdir of a vhost?

Discussion in 'Install/Configuration' started by ts77, Apr 2, 2007.

  1. ts77

    ts77 New Member

    Hey folks,

    I have a special case where I'd like to set another ext-app (which is just another php-version in my case) for a given subdirectory of my domain.

    e.g. I have the php4 external-app for the vhost myvhost.de bound to .php but
    I want to have the php5 external-app for all .php-pages below myvhost.de/admin/ used. I can't use a different file-extension there as that app needs a hell lot of changes to use that.

    Any ideas?


    thanks in advance,

    thomas
  2. mistwang

    mistwang LiteSpeed Staff

    You can try override the MIME setting for "php" file under that context,
    add something in "MIME Type" like
    Code:
    application/x-httpd-php5 php
    And you should have set a php5 external app as script handler for .php5 at vhost level.
  3. ts77

    ts77 New Member

    unfortunately this doesn't seem to work.
    Trying to save that in the context-settings adds a comma in there:
    Code:
    application/x-httpd-php5, php
    and gives me an error-message about wrong format.

    using addhandler in .htaccess didn't do any good either. :(

    this is 2.2.6-enterprise btw.

    Any further ideas?

    thanks in advance,

    thomas
  4. mistwang

    mistwang LiteSpeed Staff

    The comma should be removed, maybe a bug in 2.2.6's web admin requires that.
    You can fix the configuration file manually.
    I tried this method with 3.0.1, it works.
    Another solution is to use a rewrite rule to force MIME type of .php file to application/x-httpd-php5, you can give it a try as well.
  5. ts77

    ts77 New Member

    removing the comma doesn't help, it readds it - but thats another issue ;).

    whats the php5 in the line you posted above?
    application/x-httpd-php5 php

    is it the name of external app or the extension assigned to the external app? just want to try the right things and experiment a little bit with it.


    thanks,

    thomas
  6. mistwang

    mistwang LiteSpeed Staff

    MIME type "application/x-httpd-php5" will be added when a script handler for ".php5" has been defined, so it does not have direct relationship with an external app.

    When you override the MIME type of any file extension to "application/x-httpd-php5", that file extension will be processed with the same "Handler" defined in "php5" script handler. Hope this will help. ;)
  7. mistwang

    mistwang LiteSpeed Staff

    You can do it with
    Code:
    addType application/x-httpd-php5 php
    in "Apache style configuration"
  8. ts77

    ts77 New Member

    AddType application/x-httpd-php5 php

    in .htaccess
    did the trick for every directory I want it in.

    Thanks a lot!

    thomas

Share This Page