Solved

IIS 7.5 returns 404 and does not trigger Application_BeginRequest

Posted on 2012-12-24
11
1,826 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

617 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