.net 中带点的语义 url

3

本文介绍了.net 中带点的语义 url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试为搜索页面创建语义 url,但如果有人使用点中完成的搜索,.net 引擎会返回 404.

I'm trying to make semantic urls for search pages, but if someone use a search finished in dot, the .net engine return a 404.

请求甚至没有到达路由引擎,所以我认为它与安全或类似的东西有关.

The request don't even get to the routing engine, so i think its something related to security or something like that.

例如,stackoverflow 路由在这些情况下也不起作用:https://stackoverflow.com/questions/标记/等.

For example, the stackoverflow routes also don't work in these case: https://stackoverflow.com/questions/tagged/etc.

推荐答案

如果你使用的是 .NET 4.0 和 IIS 7+,你可以在你的 web.config 的 system.web 部分设置这个标志,它将被允许:

If you are using .NET 4.0 and IIS 7+, you can set this flag in the system.web section of your web.config and it will be allowed:

<httpRuntime relaxedUrlToFileSystemMapping="true" />

我已经对其进行了测试,并且可以正常工作.Haack 对此有解释.

I've tested it and it works. Haack has an explanation of it.

这篇关于.net 中带点的语义 url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14

函数委托与函数
Func Delegate vs Function(函数委托与函数)...
2023-11-11 C#/.NET开发问题
6

具有未知类型的 CreateDelegate
CreateDelegate with unknown types(具有未知类型的 CreateDelegate)...
2023-11-11 C#/.NET开发问题
5