Can I use mod_include.c to process .shtm, .shtml and .stm files?
May 7, 2004 12:42 PM   Subscribe

Question about Server Side Includes under IIS [more inside].

I've got a bunch of files that include Server Side Include directives supported by Apache. Unfortunately, many of them, such as #set and if-then-else logic are not supported by Microsoft's IIS, which I am now running. My question is, is it possible to take Apache's mod_include.c, compile it into a .dll, and use that to process .shtm, .shtml, and .stm files instead of ssinc.dll? Is this a really, really, really bad idea? Has someone figured out a way around this that will work using a similar approach?


There is a page on Apache's website that describes the process of compiling a module into a .dll, but I'm a bit confused on what needs to be done as I typically don't do much besides Perl/SQL.
posted by alphanerd to Computers & Internet (5 answers total)
 
Well, you can compile an Apache module into a DLL, but it still looks like you'd need to install it in Apache. Which would be dumb because Apache for Windows already has mod_include built in. But using Apache is definitely an option.

If you're set on using IIS, it would probably be easier to simply edit the files to use the ASP syntax, and then configure IIS to use the ASP filter to process .shtml etc. files.
posted by kindall at 1:40 PM on May 7, 2004


I assume IIS does proxying certain requests? You could run apache accessible only locally, and have IIS proxy requests for .shtml files to that. It all depends on your reasons for wanting to run IIS though. (Massochism comes to mind)
posted by fvw at 3:03 PM on May 7, 2004


I assume IIS does proxying certain requests?

Not natively, as far as I can tell, but you could do it pretty easily with a custom 404 error page. I.e., if a page isn't found, the 404 page requests it from Apache. Of course that'll require creating a COM object to make the HTTP request, so it'll have a lot of overhead compared to doing it the other way around (i.e. have Apache proxy to IIS).
posted by kindall at 3:36 PM on May 7, 2004


it would probably be easier to simply edit the files to use the ASP syntax

Maybe. ASP doesn't allow for conditional includes though. IIRC, all of the includes are read in before any logic is processed, so the rewriting might become a larger job than it seems.
posted by yerfatma at 6:33 AM on May 8, 2004


ASP doesn't allow for conditional includes though.

Sure it does. <% If (condition) Then Server.Execute("path_to_file") %>
posted by kindall at 1:32 PM on May 8, 2004


« Older Where can I find "It's You I like"?   |   Pub Quiz Windfall Newer »
This thread is closed to new comments.