I would like to rewrite all the urls in my project. I am doing it with the help of HttpModule. Its working fine without any query string. But in some pages query string is essential. So can't avoid it. This is the way I've written my HttpModule.
HttpApplication MyApp = (HttpApplication)sender;
string MyOldPath = MyApp.Request.Path;
OriginalURL = "~/Modules/UserMgmt/Users.aspx?self=true";
if (OriginalURL != string.Empty)
MyApp.Context.RewritePath(OriginalURL, string.Empty, string.Empty);
When I proceed this I got the "Illegal characters in path" Error.
Then I updated my webconfig as shown below.
<httpRuntime requestValidationMode="2.0" relaxedUrlToFileSystemMapping="true" requestPathInvalidCharacters="<,>,*,%,:,&,\" />
At that time the "Illegal characters in path" error solved and getting the Http 404 Error.
I could see the current url when debugging as shown below
If I am not using any url rewrite its url will be as shown below
Can anyone help me to solve this issue. Thanks in advance.