Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

404 not working for a non .aspx extention

Posted on 2006-06-24
4
Medium Priority
?
316 Views
Last Modified: 2012-05-05
I've added whats required in the web.config file

    <customErrors mode="RemoteOnly" defaultRedirect=/DefaultError.aspx">
      <error statusCode="404" redirect="FileNotFound.aspx" />

This works fine for whenever i try to type in a webpage with a .aspx extention that doesn't exist.  However, if i just try to type in "mysite.com/stuff" then it doesn't seem to trigger the 404.  Does anyone have an idea why?  Thanks.
0
Comment
Question by:UnexplainedWays
[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
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
DavidBook earned 2000 total points
ID: 16977895
when requesting this: mysite.com/stuff you are NOT requesting a URL but instead asking the webserver to serve up the default document in the /stuff directory. Normally, this is default.aspx, but could be configured to serve up index.aspx, default.aspx, index.html, default.html, etc. Each directory has  default document that will be served up if no specific URL is typed in. A URL always has a file name + extension. URL = Uniform Resource Location, or "web page". Since you are not typing in a web-page 404 won't trigger, 404 triggers when the URL is not found. No URL was requested. Get it? I would advise that you allow a default document, set IIS to serve up default.aspx, then, have default.aspx redirect to your "error page".

Hope this makes sense.
David.
 
0
 
LVL 12

Author Comment

by:UnexplainedWays
ID: 16977901
ok, thanks.
0
 
LVL 3

Expert Comment

by:DavidBook
ID: 16977944
Your welcome.
David.
0
 
LVL 12

Author Comment

by:UnexplainedWays
ID: 16977956
I went exploring around my hosting control pannel and they had a custom error page setting.  It does a different job to when there is a missing aspx file.  The local host seems to be catching all the errors with just the web.config, however my problem was on the server.

I didn't realise that a URL required an extention.  
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

721 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