문제

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.

P.S 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 :-)

P.S 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top