简体   繁体   中英

ASP.NET URL contains multi “dot” symbol

I wrote the code in global.asax contain this

oRoutes.MapPageRoute("test-route", "home/{cURL}", "~/test.aspx");

everything fine, but had error when URL contains "." symbol. And I add the code below just can fix only one dot in URL.

<httpRuntime relaxedUrlToFileSystemMapping="true" />

For Example, when I call http://foo.com/home/open.door.foo/ , the routing failed.

Is there any simple way to fix this problem? thanks.

PS 1: please don't provide the way to remove last words like ".foo", because there could be occur in my URL like http://foo.com/hey.john.open.the.book.volume.1-brabra :-)

PS 2: For some reason, I must be use "." symbol in URL. :'(

I guess based on several posts here in SO, you should encode your values

ASP.NET MVC: How to Route Search Term with . (Period) at the end

Semantic urls with dots in .net

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM