具有 Mime 映射的无扩展名 URL
我正在尝试在新主机上恢复旧站点。它最初使用MovebleType,因此所有模板文件都是无扩展名的HTML文件。我试图让 IIS7 为没有扩展名为 text/html
的文件提供所有请求,但运气不佳。 IIS 论坛上的一篇文章提出了重写规则,这对我来说没有意义并且似乎不起作用。我还尝试了几种 mimeMap,所有这些都导致了 HTTP 错误。到目前为止,这是我的 web.config:
<?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>
.htaccess 等效项更重要 - DefaultType php5-cgi
这在 IIS7 中应该是可能的,不是吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我实际上需要一个
的 MimeMap。
I actually needed a MimeMap for
.