0

最近我正在研究从 asp 到 asp.net 3.5 的重构项目。旧网站有很多.html文件使用.inc文件的页眉和页脚,需要转换为.aspx使用母版页。

我的问题是,对于搜索引擎和书签,那些旧页面都消失了,因此我需要将旧的 .html 页面重定向到 .aspx。我一直在尝试找到解决此问题的方法,最后我发现 ISAPI_Rewrite 可能是我可以使用的工具。在阅读了网站上的文档几个小时后,我仍然完全不知道如何编写语法:(

有人可以举一些例子吗?前任。将 www.example.com/en 下的所有 url 重写为 www.example.com/ 将所有 .html 重写为 .aspx

服务器使用的是 Windows 2000、IIS6、ISAPI_Rewrite 3 Lite

提前致谢

本:)

4

2 回答 2

0

You can use wildcard mappings in IIS 6. This will allow you to write your own HTTP handler to handle the rerouting of requests to the HTML pages to ASPX pages if you'd find that easy.

You could also look at urlrewriter.net which you may find easier to work with.

http://urlrewriter.net/index.php/support/installation/windows-server-2003

于 2010-01-18T11:11:37.817 回答
0

请考虑使用以下规则:

RewriteRule ^/en/(.*)\.html$ /$1.aspx [NC,R=301,L]
于 2010-02-02T10:25:58.093 回答