Solved

IIS 7.5 returns 404 and does not trigger Application_BeginRequest

Posted on 2012-12-24
11
1,771 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
Comment Utility
They are two different URLs is it two different web applications?
0
 
LVL 12

Author Comment

by:ullfindsmit
Comment Utility
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
Comment Utility
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
 
LVL 12

Author Comment

by:ullfindsmit
Comment Utility
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
Comment Utility
%20 = space
%2b = +
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 12

Author Comment

by:ullfindsmit
Comment Utility
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
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
0
 
LVL 12

Author Closing Comment

by:ullfindsmit
Comment Utility
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
Comment Utility
Glad to be of assistance.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now