带有通配符映射的 ASP.Net 1.1 在默认文档上给出 404
我有一个应用程序,要求为使用大量查询字符串值的动态页面创建一个友好的 URL。 在互联网上进行了一些研究后,我发现我需要创建一个 HttpModule 或 HttpHandler 来进行路由,然后在 IIS 中设置到 .Net v1.1 的 aspnet_isapi.dll 的通配符映射(删除验证文件存在复选框) )。
在我的 XP Pro 机器上,使用虚拟目录进行本地测试,一切正常。
当我将其提升到测试环境(Server 2003)时,直接访问页面和路由工作正常; 但是,默认文档不再有效。 我在网上找到了一个参考资料,指出由于 ASP.Net WP 和 IIS6 的分离,IIS6 在默认文档逻辑之前处理通配符映射。
我尝试更新我的 HttpHandler 以考虑 / 路由; 但是,路由页面上的代码不再起作用。 在 Web.Config 中,我尝试使用路径作为 * 和 / 并得到相同的响应。 我还使用 Response.Redirect 我觉得这是不正确的。
我也尝试过 URLRewriter.net; 然而,在花了几个小时尝试让它工作后它不起作用(由于某种原因它不会在这个 asp.net 1.1 应用程序中路由)。
关于可能的原因是什么,或者我如何获得默认页面的路由和我的特定页面设置,同时保留其余部分,有什么想法吗?
I have an application where it was requested that a friendly url be made for a dynamic page that uses a lot of query string values. After some research on the Internet, I found that I needed to create either an HttpModule or HttpHandler to do the routing and then setup a wildcard mapping to the .Net v1.1 of aspnet_isapi.dll in IIS (removing the Verify the File Exist checkbox).
Everything works fine locally on my XP Pro box using a virtual directory to test with.
When I promote it to a test environment (Server 2003), direct access to pages and the routing work fine; however, the default document no longer works. I found a reference online that states that IIS6 handles the wildcard mapping prior to the default document logic due to the separation of ASP.Net WP and IIS6.
I tried to update my HttpHandler to account for a / route; however, the code behind on the routed pages no longer work. In the Web.Config I've tried using the path as * as well as / and get the same response. I'm also using Response.Redirect which I feel is not correct.
I have also tried URLRewriter.net; however, it didn't work after spending a few hours attempting to get it working (it just wouldn't route in this asp.net 1.1 app for some reason).
Any ideas as to what may be the cause or how I could get my routes to the default page and my specific page setup while leaving the rest alone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 URLRewriter 的自述文件信息中发现了一些拼写错误。 根据在线文档而不是二进制文件附带的示例配置它后,我能够让它工作并在本地解决我的问题。
在我将代码升级到测试服务器后,预期的路由正在工作,但默认域路由仍然不工作。 我稍微修改了默认路由的 URL 模式,一切就开始工作了。
I discovered some typos in the README information for the URLRewriter. After configuring it based on the online documentation and not the examples that come with the binaries, I was able to get it to work and resolve my issue locally.
After I promoted the code to my testing server, the intended route is working but the default domain route is not still. I modified the URL Pattern for the default route a little bit and everything started working.