Configure IIS to accept URL with Special Characters (%, &, :, *)
I was working in one of the projects where our client requested to allow clean URL which contains ampersand symbol (&). The website is powered by our inhouse CMS which allow generation of clean URL (without file extensions) by page.
While it is not a good practise (at all) to allow ampersand (and other special characters) in the URL, there are some situations where you just have to work around it and accept those URL (e.g. the URL was previously created and the URL was widely spreaded).
By default, IIS will block URL requests containing special characters (%, &, :, *) for security concerns, throwing error “400 Bad Request” (or simply “Bad Request” for some cases).
The workaround is rather simple, just following the following steps. Be extra careful as it involves changes in your registry
- Set “AllowRestrictedChars” to 1 (http://support.microsoft.com/kb/820129)
- Set “VerificationCompatibility” to 1 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;826437) – yes, it applies to ASP.NET frameworks other than 1.1
- If you are running on Windows 64-bit version, you may also want to set “VerificationCompatibility” to 1 (Path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET)
- And if all the above does not help, you may want to try to set “<Page ValidateRequest=false>” on your website’s web.config
Do note that for step 1 and 2, you’ll need to restart IIS and/or HTTP related services, so you may want to follow the steps closely.
Hopefully it will help those who had the same problem as I did.
2 Comments + Add Comment
Got anything to say? Go ahead and leave a comment!
Archives
- May 2012
- March 2012
- February 2012
- July 2011
- June 2011
- May 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- March 2010
- February 2010
- January 2010
- December 2009
- September 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008



Posted under:
Hi
I am using #,+ in my url url i followed ur post but this two character is not working for above
Can you please guide me
Karthik.K
Hi
I am using Windows 7
Thanks
Karthik.K