Solved

404 not working for a non .aspx extention

Posted on 2006-06-24
4
310 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 500 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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xss alert in domino url 9 83
Making exceptions for ValidationAttribute 2 43
SP result not being displayed 5 69
Looking FTP apps that behaves similar to WinDirStat 3 33
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

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