Reputation: 10254
I'm trying to resurrect an old site on a new host. It originally used MovebleType, so all of the template files are extensionless HTML files. I'm trying to get IIS7 to serve all requests to files without an extension as text/html
but not having much luck. A post on the IIS forum suggested a rewrite rule, which to me doesn't make sense and doesn't seem to work. I've also tried several mimeMaps, all of which resulted in HTTP errors. This is my web.config so far:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<rewrite>
<rules>
<rule name="Extensionless" stopProcessing="true">
<match url="^[\w_/]+$" />
<action type="Rewrite" url="{R:0}.htm" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
The .htaccess equivalent is more to the point - DefaultType php5-cgi
This should be possible in IIS7 shouldn't it?
Upvotes: 4
Views: 3882
Reputation: 10254
I actually needed a MimeMap for .
<staticContent>
<mimeMap fileExtension="." mimeType="text/html" />
</staticContent>
Upvotes: 9