473,320 Members | 1,955 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,320 software developers and data experts.

Help please, custom 404 error

Hello this is robert,
I need some suggestion,
I have a website, hosted in windows 2003 server,shared hosting.
I would like to have a custom 404 error page, for missing files.
In the help file of my internet provider they said to do it in .NET,
like this

web.config

<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="error.aspx">
<error statusCode="404" redirect="404.aspx" />
</customErrors>
</system.web>
</configuration>

but i would like to use it also for

missing .html
missing directories
missing .asp
Any Help ?
Thanks.

Robert.
Nov 18 '05 #1
3 3583
Robert,
It won't work for files that aren't handled by the ASP.Net process.
IIS itself does allow for custom error pages so your host might be able to
hook this up for you automatically. You could set it up so that ASP.Net
handles these pages too, but of course that's a performance hit to have it
handle extra pages as it's one more step in their processing, and having
them handle .asp pages may not be a good idea either.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Bubu" <qd****@yahoo.co.uk> wrote in message
news:a8*************************@posting.google.co m...
Hello this is robert,
I need some suggestion,
I have a website, hosted in windows 2003 server,shared hosting.
I would like to have a custom 404 error page, for missing files.
In the help file of my internet provider they said to do it in .NET,
like this

web.config

<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="error.aspx">
<error statusCode="404" redirect="404.aspx" />
</customErrors>
</system.web>
</configuration>

but i would like to use it also for

missing .html
missing directories
missing .asp
Any Help ?
Thanks.

Robert.

Nov 18 '05 #2
Thanks.

Best Regards.

Robert.
Nov 18 '05 #3
Missing errors (all 404s) can be easily caught into your aspx file by doing
the following:

For this example, assume your web app is called MyApp and is located in
/inetpub/wwwroot/myapp
and your 404 page is called 404.aspx located in /inetpub/wwwroot/myapp

Your web.config stays as you have it, looks good. This will catch requests
like http://www.myserver.com/myapp/not-here.aspx or any aspx or ascx request

To intercept the missing files, goto the web server and bring up the
properties of the web app (virtual folder). Under the "Custom Errors" tab
select "404" and pick up your file /inetpub/wwwroot/myapp/404.aspx

Now that instructs IIS web server process to use your 404.aspx page for any
404 error... so missing html requests can get picked up for non asp.net
requests (and directs them to your asp.net page!)

There is probably a way to automate this in a setup file. If you don't have
control of the web server you are on, I'm not sure what to do except bribe
the administrators. Good luck

Jovo Filips

"Bubu" <qd****@yahoo.co.uk> wrote in message
news:a8*************************@posting.google.co m...
Hello this is robert,
I need some suggestion,
I have a website, hosted in windows 2003 server,shared hosting.
I would like to have a custom 404 error page, for missing files.
In the help file of my internet provider they said to do it in .NET,
like this

web.config

<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="error.aspx">
<error statusCode="404" redirect="404.aspx" />
</customErrors>
</system.web>
</configuration>

but i would like to use it also for

missing .html
missing directories
missing .asp
Any Help ?
Thanks.

Robert.

Nov 18 '05 #4

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

Similar topics

7
by: Scotter | last post by:
Hi - Simple ASPX application not running. I've given the ASP.NET, IWAM, and USR accounts full permissions to the folder my application resides in. I don't know what else needs done on the server...
11
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
0
by: Kamal Dhingra | last post by:
Hi Guys, I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
4
by: space turtle | last post by:
this is the error i get... when i got to www.hotmail.com Server Error in '/' Application. ------------------------------------------------------------------------ -------- Runtime Error...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: bimperial | last post by:
Hello folks, My first time here and I'm coming from the Coldfusion side of web applications ;) but I've inherited a task to trouble shoot some issues with some so-called simple asp.net stuff ;)....
1
by: sahilrekhi | last post by:
Hi i am working on a graphical user interface deisgn programme. when i compile the file i i get the following output with the mentioned errors: 1>------ Rebuild All started: Project: guiq,...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.