Go Back To Code List
[Web.Config]
Current Code Entry
Next Code Entry
Using a comma in your URL can be done with IIS URL Rewrite
Right Arrow
Using a Colon in your URL can be done with IIS URL Rewrite
Article Entry Date: February 20,2023 @ 03:48:13 / Last Updated On: February 3,2024 @ 08:07:25
The following error will occur when you have a Colon (:) in your URL.


IIS 10 ASP.NET Error wrote:
Server Error in '/' Application.
A potentially dangerous Request.Path value was detected from the client (:).
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).
Source Error:
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).]
System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9941168
System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0


To use a colon in your IIS Website URL, you must have the URL Rewrite module installed on the IIS Server and running on the website.
The following code will allow your website to run with a colon.

Inside your Wb.Config file, add the following.

(Change the MainName to the name of your Structure.
Example: Site.aspx?Main.aspx&Time=25:56&Page=My_Time
MainName = Folder)

In the URL Rewrite, we can create a pattern that allows certain characters to be allowed in the URL
The below example allows the colon in the URL String.
-:-
The full pattern is this. (This is what is used here on CFFCS.COM.)
([_0-9a-z-(-)-:-]+)
It is only being used in the [Time] column.
(This can be used throughout all columns and does not just have to be used in a designated column)


Other Articles Related to this Entry.

Using a comma in your URL can be done with IIS URL Rewrite«
Using a period in your URL can be done with IIS URL Rewrite«