Saturday, May 25, 2013

Server Side Include in IIS Express

To enable SSI in IIS Express, open configuration file:

C:\Users\%user%\Documents\IISExpress\config\applicationhost.config

and within it make sure that:
1) SSI is enabled - within "globalModules" section should be a tag: <add name="ServerSideIncludeModule" image="%IIS_BIN%\iis_ssi.dll" />

2) set a default document with "shtml" - within "defaultDocument" section add e.g. <add value="index.shtml" />

One more thing to note about SSI files. I was struggling a lot with includes breaking my page layout - adding empty line in every spot where #include was used. Apparently the problem is with encoding of the file. So instead of using "Unicode (UTF-8 with signature)", save your include files with "Unicode (UTF-8 without signature)" - in visual studio you can set this in menu File -> Advanced Save Options...

1 comment:

Anonymous said...

Thanks on the empty lines for server includes. Saves my day ^^