LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Setting up External App Context

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2007, 10:15 AM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
Default Setting up External App Context

Is there a way to direct only a specific file to an external app like lsphp? For example, I want to redirect /index (with no .php extension), but no other files in that directory, to php. So far, the only way I have been able to direct files to external applications is by mapping file extensions. I'm looking for something like Apache's "ForceType" directive.
Reply With Quote
  #2  
Old 06-09-2007, 10:22 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yeah, just create a static context with uri "/index" then set the "Force MIME Type" to "application/x-httpd-php".
Reply With Quote
  #3  
Old 06-09-2007, 10:29 AM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
I appreciate the quick response. Thanks!
Reply With Quote
  #4  
Old 06-09-2007, 10:54 AM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
Hmmm. This isn't working for me. I set up a static context, url = "/index.html" location = "index.html", "Force MIME Type" = "application/x-httpd-php".

But the index.html page is getting served as text.
Reply With Quote
  #5  
Old 06-09-2007, 11:25 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Is there a script handler defined for ".php"? make sure to clear your browser cache.
Reply With Quote
  #6  
Old 06-09-2007, 11:31 AM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
Quote:
Originally Posted by mistwang View Post
Is there a script handler defined for ".php"? make sure to clear your browser cache.
Yes. Accesing /index.php works fine (strangely, even though there is no index.php file).

In the help for "Force MIME Type" it says all files will be served as *static files.* Is this perhaps the problem?
Reply With Quote
  #7  
Old 06-09-2007, 11:48 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
OK, we will check the "Force MIME Type" configuration, let's try a different approach now, remove "Force MIME Type" configuration, set "Add MIME Type" with "application/x-httpd-php .html".
Reply With Quote
  #8  
Old 06-09-2007, 11:57 AM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
OK, I assume you meant "application/x-httpd-php html" (without the dot), right?

That doesn't work either.

http://www.mydomain.com/ is still served as text.

but...

http://www.mydomain.com/index.html is served as a 404 page.

I wonder if there is some interaction between this context and the rewrite rules in the virtual host?

The virtual host's rewrite rules look like this:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.html
Reply With Quote
  #9  
Old 06-09-2007, 12:08 PM
artagesw artagesw is offline
Member
 
Join Date: Jun 2007
Posts: 24
I just discovered that if I change the context URI to "/" (instead of "/index.html") it works. But I assume that this will cause all .html files to be processed by php. I would like to set it up to process only the index.html file as php and all other html files as static html.
Reply With Quote
  #10  
Old 06-09-2007, 12:21 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Does index.html exist? I don't understand why it is served as 404, maybe you should turn on debug logging.

rewrite rules at vhost level does not have a rewrite base, you need to fix the last rewrite rule by giving the full URI.

You can force the MIME type by using rewrite rule as well.
That's another option.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:15 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.