473,396 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Using customErrors (.net 2) in Web.config

Can you help!!

I have put in my web.config:
<customErrors mode="On" defaultRedirect="~/ErrorPage.aspx">
<error statusCode="403" redirect="~/ErrorPage.aspx"/>
<error statusCode="404" redirect="~/ErrorPage.aspx"/>
</customErrors>

This works when you put in a invalid page ie www.mysite.com/test.aspx.
The problem I have is that if you put anything else in the URL like:
www.mysite.com/test.asp or www.mysite.com/test the error page is NOT
shown.

What have I done wrong?????

Jul 21 '06 #1
1 963
You have done nothing wrong.
Your web.config entries only apply to files mapped to aspnet_isapi.dll.

You can do two things to get more functionality.

1. Map the extensions you want caught to aspnet_isapi.dll.
That might cause some performance loss.

2. Edit the standard IIS http error pages so they return the info you want returned.
They are located in Drive:\%WINDIR%\Help\iisHelp\common

Make sure you back them up first...just in case somethng goes wrong.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<st*************@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Can you help!!

I have put in my web.config:
<customErrors mode="On" defaultRedirect="~/ErrorPage.aspx">
<error statusCode="403" redirect="~/ErrorPage.aspx"/>
<error statusCode="404" redirect="~/ErrorPage.aspx"/>
</customErrors>

This works when you put in a invalid page ie www.mysite.com/test.aspx.
The problem I have is that if you put anything else in the URL like:
www.mysite.com/test.asp or www.mysite.com/test the error page is NOT
shown.

What have I done wrong?????

Jul 21 '06 #2

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

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
3
by: Manny Chohan | last post by:
Hi all, I have set up forms authentication using web.config file. Its storing the userid in sqlAuthCookie. Is there a direct command to retrieve this userid instead of reading in cookie and...
2
by: Matthias S. | last post by:
Hi there, in my customErrors defaultRedirect-Page I'd like to know what the failing status-code actually was, eg. 404 (file not found), so that I can display a message accordingly. any ideas how...
4
by: Carlos | last post by:
Hi all, is it possible to configute an asp .net app using web config, to allow access to users within a particular domain only?. Any help is greatly appreciated. Thanks in advance, Carlos
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
2
by: John Wildes | last post by:
hello I was wondering if someone could point me in the direction of information on using app.config to store string variables. I have a couple of variables that store path information for file...
1
by: kristian | last post by:
I'm using the following entry in my web.config: web.config <customErrors mode="On" defaultRedirect="~/CMS/Default.aspx"> <error statusCode="404" redirect="~/CMS/Default.aspx"/> </customErrors> ...
4
by: John Bailo | last post by:
What's the cost of using a web.config key in a web method? Is the value cached at start up? Or at first run? Or read on each access? Is web.config always "read off the disk" or can the...
0
by: Pavani.B | last post by:
Hi! Group, We have uses the personalization concept using web.config file means we can add some elements in profile within that properties tag we have create one group in that group we have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.