使用带有一个名为.htm自定义URL重写,IIS6和URL,html的,等 [英] Using a custom URL rewriter, IIS6, and urls with .htm, .html, etc

查看:114
本文介绍了使用带有一个名为.htm自定义URL重写,IIS6和URL,html的,等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义网站我建设具有自动URL使用自定义的发动机改写。在重写工作正常,只要在网页URL中不服用点像.htm或.html结束。对于这些网页它会首先打我重写引擎直接到IIS 404页,而不是。

I have a custom site I'm building with automatic url rewriting using a custom engine. The rewriting works fine as long as the page url doesn't end in somehting like .htm or .html. For these pages it goes directly to the iis 404 page instead of hitting my rewriting engine first.

我有一个网站的IIS6配置的主目录部分中的*通配符的处理程序,但这些网址似乎被它忽略(altho的东西如CSS,JPG,JS等,以获取发送到URL处理器在我的web项目)。我如何设置IIS6迫使这些网址被发送到处理程序,同时仍提供该页面,如果它存在是否正常?

I have the * wildcard handler in the "Home Directory" section of the IIS6 configuration of that website but these urls seem to be ignored by it (altho things like css, jpg, js, etc to get sent to the url handler in my web project). How do i set up IIS6 to force these urls to get sent to the handler, while still serving the page if it exists normally?

该处理器基本上做到这一点

The handler basically does this

if (!File.Exists(Request.Path))
{
    doMyRewriting();
}

我必须假设,使用这样的块(公正,例如,真正的做一些其他的东西来格式化Request的是正确的一切)应该运行doMyRewriting(),如果所需的文件呢不存在否则通常会提供页面。我是不是弄错了?

I have to assume that using a block like this (just and example, the real one does some other stuff to format the Request.Path to be proper with everything) should run the "doMyRewriting()" if the requested file does not exist otherwise it will serve the page normally. Am I mistaken?

如果我告诉IIS专门派的.htm和.html页面直通到.NET处理程序的重写工作,但如果网页实际上是有它不会为它服务。

If I tell IIS specifically to send .htm and .html pages thru to the .NET handler the rewriting works but if the page is actually there it will not serve it.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

在此先感谢!

推荐答案

不知道你是否能或会想这样做,但在离子学的ISAPI URL重写即可使用。

Don't know if you can or would want to do this, but there is the Ionics Isapi url rewriter you can use.

HTTP://www.$c$cplex.com/IIRF

基本上安装然后设置一个规则来删除的.html这样,它击中了你的重写引擎。我用它在IIS 6我的几个博客。

Basically install that then set a rule to remove the .html that way it hits your rewrite engine. I use it on IIS 6 with several of my blogs.

这篇关于使用带有一个名为.htm自定义URL重写,IIS6和URL,html的,等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆