472,780 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

Custom Errors

Hi,
I've set up a custom error like this

<customErrors mode="On" defaultRedirect="ErrorPage.aspx">
<error statusCode="404" redirect="error404.aspx" />
</customErrors>

So requests for NoSuchPage.aspx are routed to error404.aspx. Good. But it
seems that requests for any other file extension (*.htm) or requests without
a filename (eg www.site.com/nosuchfolder) are routed to the default 404
page. Is this by design or is there something I need to modify to send all
bad requests to the custom error page?
Ideally i want users to be able to type www.site.com/productid (where
productid will always be a 10 digit number) send the request to
error404.aspx strip out the product id and redirect to
showproduct.aspx?id=productid but as it stands a request like that will go
to the default 404 page

Cheers,
Jon
Nov 18 '05 #1
4 1859
The problem is that on Win2000/XP ASP.NET is not tightly integrated with
IIS. It's just hooked up to certain extensions as an ISAPI DLL

So request for any extension like htm, gif,... (which is not hooked up to
ASP.NET ) does not go through ASP.NET and your webconfig is ignored.

The solution is to upgrade to Win2003.

George.
"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
Hi,
I've set up a custom error like this

<customErrors mode="On" defaultRedirect="ErrorPage.aspx">
<error statusCode="404" redirect="error404.aspx" />
</customErrors>

So requests for NoSuchPage.aspx are routed to error404.aspx. Good. But it
seems that requests for any other file extension (*.htm) or requests without a filename (eg www.site.com/nosuchfolder) are routed to the default 404
page. Is this by design or is there something I need to modify to send all
bad requests to the custom error page?
Ideally i want users to be able to type www.site.com/productid (where
productid will always be a 10 digit number) send the request to
error404.aspx strip out the product id and redirect to
showproduct.aspx?id=productid but as it stands a request like that will go
to the default 404 page

Cheers,
Jon

Nov 18 '05 #2
This sounds good, I'm developing on XP Pro IIS5.1 but will host on Win2003
IIS6. Are you saying the custom errors will work as I want when I go into
production?

Jon

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
The problem is that on Win2000/XP ASP.NET is not tightly integrated with
IIS. It's just hooked up to certain extensions as an ISAPI DLL

So request for any extension like htm, gif,... (which is not hooked up to
ASP.NET ) does not go through ASP.NET and your webconfig is ignored.

The solution is to upgrade to Win2003.

George.
"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
Hi,
I've set up a custom error like this

<customErrors mode="On" defaultRedirect="ErrorPage.aspx">
<error statusCode="404" redirect="error404.aspx" />
</customErrors>

So requests for NoSuchPage.aspx are routed to error404.aspx. Good. But it seems that requests for any other file extension (*.htm) or requests

without
a filename (eg www.site.com/nosuchfolder) are routed to the default 404
page. Is this by design or is there something I need to modify to send all bad requests to the custom error page?
Ideally i want users to be able to type www.site.com/productid (where
productid will always be a 10 digit number) send the request to
error404.aspx strip out the product id and redirect to
showproduct.aspx?id=productid but as it stands a request like that will go to the default 404 page

Cheers,
Jon


Nov 18 '05 #3
Yes.
But you will need to test it with Win2003 before moving to production.
George.

"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
This sounds good, I'm developing on XP Pro IIS5.1 but will host on Win2003
IIS6. Are you saying the custom errors will work as I want when I go into
production?

Jon

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
The problem is that on Win2000/XP ASP.NET is not tightly integrated with
IIS. It's just hooked up to certain extensions as an ISAPI DLL

So request for any extension like htm, gif,... (which is not hooked up to
ASP.NET ) does not go through ASP.NET and your webconfig is ignored.

The solution is to upgrade to Win2003.

George.
"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
Hi,
I've set up a custom error like this

<customErrors mode="On" defaultRedirect="ErrorPage.aspx">
<error statusCode="404" redirect="error404.aspx" />
</customErrors>

So requests for NoSuchPage.aspx are routed to error404.aspx. Good. But
it seems that requests for any other file extension (*.htm) or requests

without
a filename (eg www.site.com/nosuchfolder) are routed to the default 404 page. Is this by design or is there something I need to modify to send all bad requests to the custom error page?
Ideally i want users to be able to type www.site.com/productid (where
productid will always be a 10 digit number) send the request to
error404.aspx strip out the product id and redirect to
showproduct.aspx?id=productid but as it stands a request like that
will go to the default 404 page

Cheers,
Jon



Nov 18 '05 #4
Done some testing on Win2003/iis6 and custom errors are still behaving the
same way ie only working for .aspx pages. So I went into IIS and set the 404
to 404.aspx - requests for anything other than .aspx are routed to this page
..aspx requests go to the error page defined in web.config. This isn't ideal
but it does work.

Thanks for your help,
Jon

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OG**************@TK2MSFTNGP11.phx.gbl...
Yes.
But you will need to test it with Win2003 before moving to production.
George.

"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
This sounds good, I'm developing on XP Pro IIS5.1 but will host on Win2003
IIS6. Are you saying the custom errors will work as I want when I go into production?

Jon

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
The problem is that on Win2000/XP ASP.NET is not tightly integrated with IIS. It's just hooked up to certain extensions as an ISAPI DLL

So request for any extension like htm, gif,... (which is not hooked up to ASP.NET ) does not go through ASP.NET and your webconfig is ignored.

The solution is to upgrade to Win2003.

George.
"Jon Spivey" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
> Hi,
> I've set up a custom error like this
>
> <customErrors mode="On" defaultRedirect="ErrorPage.aspx">
> <error statusCode="404" redirect="error404.aspx" />
> </customErrors>
>
> So requests for NoSuchPage.aspx are routed to error404.aspx. Good. But it
> seems that requests for any other file extension (*.htm) or requests
without
> a filename (eg www.site.com/nosuchfolder) are routed to the default 404 > page. Is this by design or is there something I need to modify to
send all
> bad requests to the custom error page?
> Ideally i want users to be able to type www.site.com/productid

(where > productid will always be a 10 digit number) send the request to
> error404.aspx strip out the product id and redirect to
> showproduct.aspx?id=productid but as it stands a request like that

will
go
> to the default 404 page
>
> Cheers,
> Jon
>
>



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark Metzner | last post by:
We currently have custom error logging setup on all of our websites. We have IIS setup to redirect to our custom 500-100.asp page which logs the error to a database and then redirects to a...
1
by: Tamas Demjen | last post by:
I started to experiment with VC++ 2005 Beta1. So far everything went fine, and already have a working project, but soon I realized that the compiler was ancient (not supporting half of the C++/CLI...
2
by: Matt | last post by:
Hello all, The app we are working on uses custom errors extensively to provide friendly error pages to users whilst logging the actual exceptions behind the scenes. However.... We are now...
6
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
5
by: Richard | last post by:
I have been struggling with this for days. I feel I must be missing something simple, and I will be eternally grateful for any help. I'm using VS.NET 2003 on XP Pro Sp2. I searched and found...
0
by: gilly3 | last post by:
I'm coming across all kinds of frustration implementing custom errors in ASP.NET 1.1. First, 401 - Authorization Failed My application uses Windows Integrated Authentication, and restricts...
4
by: =?Utf-8?B?QWxm?= | last post by:
Hello all, I am having trouble dealing with ~(tilde) in my .Net 1.1 web application, specially when it comes through the URL. For example, when someone requests the following URL:...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.