ISAPI 重写规则帮助 ( .html -> .aspx )

发布于 2024-08-18 04:59:20 字数 415 浏览 5 评论 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

提前致谢

ben :)

Recently I'm working on a refactor project from asp to asp.net 3.5.
There are lots of .html file uses .inc file for the header and footer in the old site, and needed to be converted to .aspx uses master page.

My problem is, for search engine and for bookmark those old pages are all gone
Therefore I need to redirect the old .html pages to .aspx.
I've been trying to find a way to fix that, finally i found ISAPI_Rewrite might be the tool that i can use. After a few hours reading the document on the site, i still have no clue how to write the syntax at all :(

Could anyone give a some examples please?
ex. rewrite all urls under www.example.com/en to www.example.com/
rewrite all .html to .aspx

The server is using Windows 2000, IIS6, ISAPI_Rewrite 3 Lite

Thanks in advance

ben :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

高跟鞋的旋律 2024-08-25 04:59:20

您可以在 IIS 6 中使用通配符映射。这将允许您编写自己的 HTTP 处理程序来处理将 HTML 页面请求重新路由到 ASPX 页面(如果您觉得这很容易的话)。

您还可以查看 urlrewriter.net,您可能会发现它更容易使用。

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

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

我的奇迹 2024-08-25 04:59:20

请考虑使用以下规则:

RewriteRule ^/en/(.*)\.html$ /$1.aspx [NC,R=301,L]

Please consider using the following rule:

RewriteRule ^/en/(.*)\.html$ /$1.aspx [NC,R=301,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文