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

ts77

Well-Known Member
#1
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
 

mistwang

LiteSpeed Staff
#2
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.
 

ts77

Well-Known Member
#3
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
 

mistwang

LiteSpeed Staff
#4
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.
 

ts77

Well-Known Member
#5
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
 

mistwang

LiteSpeed Staff
#6
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. ;)
 

ts77

Well-Known Member
#8
AddType application/x-httpd-php5 php

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

Thanks a lot!

thomas
 
Top