kenjpete
asked on
Server Side Includes Not Working on Windows 2008/IIS 7
We have a Windows 2008 web server running IIS7 and cannot seem to get ServerSideIncludes to work despite following all the instructions we could find. Here are the steps we have completed:
1. Enabled SSIs in IIS 7
2. Confirmed ServerSideIncludes was shown as "installed" under Application Development
3. Added *.html as a mapping in "Add Mapping Module"
4. Created "inc" folder in our web site to hold all included files, and set that folder to have "execute" rights for scripts.
5. Added this code to web.config file to be sure SSIs were enabled:
<location path="d:\webs\[ourwebname] ">
<system.webServer>
<serverSideInclude ssiExecDisable="false" />
</system.webServer>
</location>
6. Added this line of code to my default.html file to serve included content:
<!-- #include file = "/inc/myfile.html" -->
When I upload default.html to our server and view it in a browser the file displays but the included content does not appear. When I look at the source code for that page it shows my code above as an HTML comment and is not executing the code?
Also, if I change the extension to .shtml and upload that file to our server and then view it in a browser I get an "Error 404 - File Not Found" error?
What am I missing or doing wrong?
1. Enabled SSIs in IIS 7
2. Confirmed ServerSideIncludes was shown as "installed" under Application Development
3. Added *.html as a mapping in "Add Mapping Module"
4. Created "inc" folder in our web site to hold all included files, and set that folder to have "execute" rights for scripts.
5. Added this code to web.config file to be sure SSIs were enabled:
<location path="d:\webs\[ourwebname]
<system.webServer>
<serverSideInclude ssiExecDisable="false" />
</system.webServer>
</location>
6. Added this line of code to my default.html file to serve included content:
<!-- #include file = "/inc/myfile.html" -->
When I upload default.html to our server and view it in a browser the file displays but the included content does not appear. When I look at the source code for that page it shows my code above as an HTML comment and is not executing the code?
Also, if I change the extension to .shtml and upload that file to our server and then view it in a browser I get an "Error 404 - File Not Found" error?
What am I missing or doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, that has the right direction: http://www.iis.net/configreference/system.webserver/serversideinclude
ASKER
Thanks for that reference. I did see that previously but I'm still struggling to understand the second part that talks about how the SSIs need to be set up programmatically?
After my web server admin completes the steps in the setup section for the server, I need to add the configuration code...correct? Where does that code go, in the web.config file? If so, I did that previously and it had no affect.
Secondly, where does the sample code go? I'm not clear on this?
After my web server admin completes the steps in the setup section for the server, I need to add the configuration code...correct? Where does that code go, in the web.config file? If so, I did that previously and it had no affect.
Secondly, where does the sample code go? I'm not clear on this?
ASKER
Any idea why I would get an Error 404 whenever I try to view a web page with a .shtml or .shtm file extension? I get this error even if the .shtml/.shtm file had no include statement?
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.