Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IIS 7.5 returns 404 and does not trigger Application_BeginRequest

Posted on 2012-12-24
11
Medium Priority
?
1,855 Views
Last Modified: 2012-12-24
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
Comment
Question by:ullfindsmit
11 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38718914
They are two different URLs is it two different web applications?
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 38718924
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
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 38718965
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 12

Author Comment

by:ullfindsmit
ID: 38719015
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
 
LVL 26

Expert Comment

by:pony10us
ID: 38719022
%20 = space
%2b = +
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 38719027
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
 
LVL 26

Expert Comment

by:pony10us
ID: 38719034
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
 
LVL 12

Author Comment

by:ullfindsmit
ID: 38719053
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
 
LVL 26

Accepted Solution

by:
pony10us earned 2000 total points
ID: 38719071
0
 
LVL 12

Author Closing Comment

by:ullfindsmit
ID: 38719084
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
 
LVL 26

Expert Comment

by:pony10us
ID: 38719085
Glad to be of assistance.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question