Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow CON, reserved keywords in URLs

Tags:

c#

.net

url

iis

I need to allow URL's that have some reserved keywords like CON, AUX, NUL etc in the URL Names eg: ..../CON/...

Right now I get a 404 Error and the following exception when I try to go to such an URL:

[HttpException]
   at System.Web.CachedPathData.GetConfigPathData(String configPath)
   at System.Web.HttpContext.GetFilePathData()

This has been fixed for .Net 4 according to other posts on this site Semantic urls with dots in .net , I however cannot upgrade to .Net4 due to other dependencies so need an alternative way of doing this.

like image 453
taiyo Avatar asked Nov 24 '10 02:11

taiyo


1 Answers

According to Microsoft's response to this on connect and MSDN forums, there is no workaround in asp.net other than upgrading to 4.0. You could try using IIS url rewriting, but you still can't actually put COM1 (or whatever) in your routes.

(See also: http://haacked.com/archive/2010/04/29/allowing-reserved-filenames-in-URLs.aspx)

like image 123
Philip Rieck Avatar answered Sep 22 '22 13:09

Philip Rieck