.net 中带点的语义网址 [英] Semantic urls with dots in .net
问题描述
我正在尝试为搜索页面制作语义网址,但如果有人使用以点完成的搜索,.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/tagged/etc.
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 中带点的语义网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!