Pergunta

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. :'(

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top