如何在ASP.NET 3.5(IIS 7.5)中进行URL映射

编程入门 行业动态 更新时间:2024-10-27 14:35:13
本文介绍了如何在ASP.NET 3.5(IIS 7.5)中进行URL映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

亲爱的, 我在尝试过的部分中使用了URL映射。在Visual Studio中工作正常,但是当我在IIS 7.5中进行部署时,它说404错误资源未找到&我也尝试重写规则&重写地图 仍然没有工作。 我在拼图。请帮助我。 问候 Mahmud 我尝试过:

Dear, I am using URL Mapping showed in tried section. works fine in visual studio,but when i go to deployment in IIS 7.5 it says 404 error resource not found & i also try rewrite rules & rewrite map still not not work. I am in puzzle.please help me. Regards Mahmud What I have tried:

Quote:

its。

<urlMappings enabled="true"> <add url="~/User/Dashboard" mappedUrl="~/UserManagement/Default.aspx"/> <add url="~/Employee/employee" mappedUrl="~/Employee_Personal/employee.aspx"/> <add url="~/Requistion/Product" mappedUrl="~/Requistion/product.aspx"/> <add url="~/Requistion/Vehicle" mappedUrl="~/Requistion/vehicle-details.aspx"/> <add url="~/Requistion/Supplier" mappedUrl="~/Requistion/supplier.aspx"/> <add url="~/Requistion/Driver" mappedUrl="~/Requistion/driver.aspx"/> <add url="~/Requistion/Requisition" mappedUrl="~/Requistion/requisition.aspx"/> <add url="~/Requistion/Requisition-Approve" mappedUrl="~/Requistion/approve-requisition.aspx"/> <add url="~/Requistion/Gate-Pass" mappedUrl="~/Requistion/gate-pass.aspx"/> <add url="~/Requistion/Requsition-Car" mappedUrl="~/Requistion/requistion-for-car.aspx"/> <add url="~/Requistion/Requsition-Car-Approve" mappedUrl="~/Requistion/approve-requistion-car.aspx"/> </urlMappings>

Quote:

I谷歌搜索了很多时间&尝试

I have googled lots of time & try

<rewrite> <rules> <remove name="Rewrite rule1 for StaticRewrites" /> <rule name="Redirect rule1 for StaticRewrites"> <match url=".*" /> <conditions> <add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)" /> </conditions> <action type="Redirect" url="{C:1}" appendQueryString="false" /> </rule> </rules> <rewriteMaps> <remove name="StaticRewrites" /> <rewriteMap name="StaticRewrites"> <add key="~/Employee_Personal/employee" value="~/Employee_Personal/employee.aspx" /> </rewriteMap> </rewriteMaps> </rewrite>

推荐答案

对于URL重写规则,您需要在服务器上安装URL Rewrite模块: URL重写:官方Microsoft IIS站点 [ ^ ] 对于URL映射,您可能需要安装此修补程序 [ ^ ],或应用其中一个解决方法以确保为无扩展名URL调用ASP.NET: 在IIS 7.5上使用ASP.NET 4.0无扩展路由 - Sven Aelterman [ ^ ] For the URL rewriting rules, you'll need to install the URL Rewrite module on the server: URL Rewrite : The Official Microsoft IIS Site[^] For the URL mappings, you might need to install this hotfix[^], or apply one of the workarounds to ensure that ASP.NET is invoked for extensionless URLs: Using ASP.NET 4.0 Extension-less Routing on IIS 7.5 – Sven Aelterman[^]

更多推荐

如何在ASP.NET 3.5(IIS 7.5)中进行URL映射

本文发布于:2023-11-12 04:51:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580555.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   NET   ASP   IIS   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!