如何在ASP.NET 3.5(IIS 7.5)中进行URL映射 [英] How do I URL mapping in ASP.NET 3.5(IIS 7.5)

查看:81
本文介绍了如何在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映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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