3

We're in the middle of a migration from IIS6/2003 to IIS8/2012. We have to maintain some Classic ASP and ASP and .NET apps. The full applications seem to work fine (as in, the ones I went in to IIS, right clicked on the folders and did "Convert to Application"), but our site relies heavily on menus that are included html files. The weird thing is, I'm 99% sure this was working before, but when we went to flip the switch for the new server, the menus didn't appear.

The file structure looks like this

wwwroot/dir/blah.html
wwwroot/dir/incb.html
wwwroot/ssi/inca.html

Now, within blah.html, I have two includes:

<!-- #include file="incb.html" -->
<!-- #include virtual="ssi/inca.html" -->

The first one works, the second doesn't. I tried this:

<!-- #include file="../ssi/inca.html" -->

But it still wasn't included, and just appears as a comment on the final page. I tried playing with/checking the permissions, but it looks correct. I also have "Enable Parent Paths" set as true under IIS->ASP for the server and the site itself. Was wondering if anyone had any thoughts?

UnsettlingTrend
  • 452
  • 1
  • 5
  • 20
  • Are your `dir` and `ssi` folders under `wwwroot` setup as individual websites? Remember `wwwroot` is usually the root of the web server (classic path in IIS is `c:\inetpub\wwwroot`) not a website. – user692942 Jul 08 '14 at 08:47
  • The `` is wrong because it's going to look for a virtual path from the current directory so in your `blah.html` you're looking for `wwwroot/dir/ssi/inca.html`, try `` to look for `wwwroot/ssi/inca.html` (this will only work if `wwwroot` is defined as a website and not the root of your web server, as I mentioned previously). – user692942 Jul 08 '14 at 08:50

3 Answers3

7

Enable the Server Side Include module as a feature in Server Management, then add a handler mapping for .html to the SSI module.

This guy goes over it all: https://www.youtube.com/watch?v=foLClXY3wTE

UnsettlingTrend
  • 452
  • 1
  • 5
  • 20
4

Under the ASP section in IIS did you enable parent paths? This is disabled by default.

Sean Lange
  • 33,028
  • 3
  • 25
  • 40
  • Sorry, forgot to add that. Yes, I set "Enable Parent Paths" as True. – UnsettlingTrend Jul 07 '14 at 19:49
  • Such a strange reputation system here. I have to provide an "answer" to ask for supporting information because I can't add a comment. But I can add a comment to my own "answer". >. – Sean Lange Jul 07 '14 at 20:03
  • Since you know the inca.html file will always be at the root can you reference it as such? – Sean Lange Jul 07 '14 at 20:03
  • That doesn't work either; and from what I've read, I thought I had to leave the preceding slash off for it to use the root of the website. – UnsettlingTrend Jul 07 '14 at 20:10
  • If you don't specify the root with the preceding slash it thinks you want to start with the current directory. Do you get an error message? Is the folder ssi a physical folder located in the file system as a subfolder of the root of the site? If not, you will need to switch to virtual instead. – Sean Lange Jul 07 '14 at 20:16
  • http://stackoverflow.com/questions/16106820/virtual-include-not-working That says no leading slash. But I had tried it both ways. It's a physical path, but I've also tried it as file and virtual, as my question stated, but nothing. – UnsettlingTrend Jul 07 '14 at 20:56
  • @SlakeFistcrunch The leading slash tells `#include virtual` to start at the site root. I'm not a big fan of `#include file` and tend to use `#include virtual` for most situations. The only time I will use `#include fil`e is for files that are self contained within their own folder structure that never changes. – user692942 Jul 08 '14 at 09:52
  • @SlakeFistcrunch Plus your linked answer does not say *"no leading slash"* it says no leading slash in the context of `#include file`, this is correct but when using `#include virtual` a leading slash is valid. Don't confuse the two. – user692942 Jul 08 '14 at 09:54
  • Sorry about that, it confused me. Turns out the Server Side Include module wasn't turned on. I didn't think about this, since #include file with the local file was working; I guess there's more a difference between the two than I realized. – UnsettlingTrend Jul 08 '14 at 20:01
0

I solved that issue by setting up the application as a virtual directory instead of a site. And the name of the application must be the same as the folder, in this case 'ssi'