Solved

ASP.Net HTTP 404 Error

Posted on 2013-06-24
15
403 Views
Last Modified: 2013-06-25
For some reason the request to http://www.dealer24x7.com/HONDA/Civic%20U.S./Richmond/VA/23235/New/1/Inventory/ never reaches the app
But if you request
http://www.dealer24x7.com/HONDA/Civic%20US/Richmond/VA/23235/New/1/Inventory/ it will

Not sure what is causing it and how to fix it.

I am guessing its a simple web.config change, but not 100% sure
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
  • 7
  • 4
  • 3
  • +1
15 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39272398
I expect the first URL is read with everything after the first period as the file extension for the page.  

In either case, that is a horrible, horrible, HORRIBLE URL.
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 39272416
Can we please stay on topic?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39272491
Are you using URL rewriting in your site?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 12

Author Comment

by:ullfindsmit
ID: 39272523
Yes
I am rewriting the URL on the Application_BeginRequest event
It works for all other URLs, but is causing trouble for these one off URLs
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39272529
What is the pattern that should be handling the erroneous request?
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 39272646
Its all custom code
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39272775
Without seeing it all I can say is that you've got a flaw in your logic. As far as the browser and server are concerned, "US" is different than "U.S." so you need to adjust your logic to handle either.
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 39272819
The issue I have is, it doesnt even hit the .Net framework for the URL rewrite to work
0
 
LVL 11

Expert Comment

by:lenordiste
ID: 39272988
try adding this to your handlers so that IIS correctly have .NET process the request. The idea is to match the URL with dots, you may need to adjust the path according to your application: my example will only take care of all urls with /HONDA/ since I do not know what other kind of url schemes you have. Also, you may want to remove the verbs you don't need.

<system.webServer>
    <handlers>
      <add name="DotRequestHandler" path="/HONDA/*" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

Open in new window


on a side note, while the above will work having dots in the url is maybe not the best idea, I am not even sure how SEO compatible this is... you may want to rewrite those and replace dots with some other character.
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 39273548
I changed it on the beta site
http://beta.dealer24x7.com/HONDA/Civic%20U.S./Richmond/VA/23235/New/1/Inventory/ to
<system.webServer>
    <handlers>
      <add name="DotRequestHandler" path="*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="" />
    </handlers>
  </system.webServer>

Open in new window

and still no joy
0
 
LVL 11

Accepted Solution

by:
lenordiste earned 500 total points
ID: 39275423
Try to add thid in addition to your new request handler:
<httpRuntime relaxedUrlToFileSystemMapping="true" />

Open in new window


More info here: http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.relaxedurltofilesystemmapping.aspx
0
 
LVL 12

Author Closing Comment

by:ullfindsmit
ID: 39275788
Thank you all

            <httpRuntime relaxedUrlToFileSystemMapping="true" />

Did the trick
0
 
LVL 11

Expert Comment

by:lenordiste
ID: 39275963
did you still need the request handler?
0
 
LVL 12

Author Comment

by:ullfindsmit
ID: 39275982
No
Just the httpruntime did the trick
0
 
LVL 11

Expert Comment

by:lenordiste
ID: 39276149
ok so that means the problem was because part of the path contained a trailing point which would not be possible in a windows OS. The default validation is similar to the one used for windows file system paths. The setting simply removes that type of validation. I'm not sure there's much side effects aside from your .NET code having more garbage URL to check if someone tempers with it.

Happy this worked for you :)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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