PDA

View Full Version : Server side includes



jeffryf
2010-03-27, 06:34 PM
I'm adding server side includes to and existing site for a non-profit organization. It's hosted on the IIS 7.0 server. The source files are simple html, but there's a lot of them. I can easily implement this, but to make the server happy I have to change the extension to shtml. Again, not a problem in itself. Here's the problem. The site is referenced by a bunch of other sites and a wide variety of users likely have specific pages bookmarked so they'll continue to open the old html pages.

On a LAMP server, I'd just write a htaccess file, but I have no idea how to handle this in IIS other than to turn each html file into a redirect itself.

I'm not familiar with IIS so any thoughts are appreciated.

jeremya
2010-03-29, 10:11 AM
You should be able to achieve this with a custom web.config file. You'll need to make individual entries for each redirect but it's far easier than performing each one individual in the IIS interface.

<location path="example.html">
<system.webServer>
<httpRedirect enabled="true" destination="http://test.com/example.shtml" exactDestination="true" childOnly="true" httpResponseStatus="Permanent" />
</system.webServer>
</location>

SmartSmith
2010-04-16, 04:13 PM
agreed. You'll save a LOT of time this way.

FutbolFred
2010-04-19, 06:09 PM
And don't forget to back up your files before you start messin' around!!