Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1891
  • Last Modified:

IIS 7.5 returns 404 and does not trigger Application_BeginRequest

For some weird reason IIS 7.5 will not fire application_beginrequest for
http://dealer24x7.com/1990-1994/Used/1/By-Pass+Motors/Inventory/
But will fire for http://dealer24x7.com/1990-1994/Used/1/By-Pass Motors/Inventory/

Any ideas why?
0
ullfindsmit
Asked:
ullfindsmit
1 Solution
 
Neil RussellTechnical Development LeadCommented:
They are two different URLs is it two different web applications?
0
 
ullfindsmitAuthor Commented:
No same application
Same Server

One is URL Encoded (right way) and does not work
Other is NOT URL Encoded (manually changed it to test) and works
0
 
Vikram Singh SainiSoftware Engineer cum AD DeveloperCommented:
Hi,

Based on the url you showed us from your question, I am guessing you are using UrlEncode method.

And providing you more detail on that I'm picking paragraph from HttpUtility.UrlEncode Method (String):

You can encode a URL using with the UrlEncode method or the UrlPathEncode method. However, the methods return different results. The UrlEncode method converts each space character to a plus character (+). The UrlPathEncode method converts each space character into the string "%20", which represents a space in hexadecimal notation. Use the UrlPathEncode method when you encode the path portion of a URL in order to guarantee a consistent decoded URL, regardless of which platform or browser performs the decoding.

So I would recommend you to use UrlPathEncode method instead of UrlEncode method.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ullfindsmitAuthor Commented:
vs00saini
Its not about how to encode the path, but rather how do I fix IIS to trigger the Application_BeginRequest function so the page shows up

Thanks.
0
 
pony10usCommented:
%20 = space
%2b = +
0
 
ullfindsmitAuthor Commented:
GUYS
SERIOUSLY
YOU NEED TO READ THE POST

I AM NOT ASKING ON HOW TO REWRITE THE URL

I am trying to figure out why the Application_BeginRequest is not being fired and why IIS would not forward the request to the .Net framework

Thanks
0
 
pony10usCommented:
It is not forwarding because it is interpreting the "+" sign NOT as a space character because of the difference between the code.  

http://stackoverflow.com/questions/2678551/when-to-encode-space-to-plus-and-when-to-20
0
 
ullfindsmitAuthor Commented:
Thank you for your prompt response.

What do I need to change (Except for the URL, because it comes from various sources) on IIS to make it work?

Please advise
Smit.
0
 
ullfindsmitAuthor Commented:
Excellent
Like hot knife through butter... worked flawlessly

All I had to do was add

<system.webServer>
    <security>
            <requestFiltering allowDoubleEscaping="true" />
    </security>
</system.webServer>

Thank you
0
 
pony10usCommented:
Glad to be of assistance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now