473,625 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

<configuratio n>
<system.web>
<customErrors mode="On" defaultRedirect ="error.aspx ">
<error statusCode="404 " redirect="404.a spx" />
</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 3590
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.c o.uk> wrote in message
news:a8******** *************** **@posting.goog le.com...
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

<configuratio n>
<system.web>
<customErrors mode="On" defaultRedirect ="error.aspx ">
<error statusCode="404 " redirect="404.a spx" />
</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.c o.uk> wrote in message
news:a8******** *************** **@posting.goog le.com...
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

<configuratio n>
<system.web>
<customErrors mode="On" defaultRedirect ="error.aspx ">
<error statusCode="404 " redirect="404.a spx" />
</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
1738
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 so that .Net applications run on it. I do see under "Control Panel --> Administrative Tools" two .Net related items: * Microsoft .Net Framework 1.1 Configuration * Microsoft .Net Framework 1.1 Wizards Do I need to use these to set something up?...
11
1909
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 this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73, object expected.
3
4861
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 protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
0
1306
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 problem is i want 2 different custom error handling files ,one for the main site and other for the admin.In the config file in admin I wrote <customErrors defaultRedirect="CustomErrorAdmin.aspx" mode="On" /> and in the other config file i wrote ...
4
1474
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 Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It
12
5322
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 the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
0
5557
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
2
1318
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 ;). I've run into something right off the bat that I'm not familiar with, on the page here: http://medicine.med.unc.edu/about/directory.aspx When clicking any of the search function buttons, it bombs out and I haven't a clue where to start so any help...
1
5313
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, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'guiq', configuration 'Debug|Win32' 1>Compiling... 1>stdafx.cpp 1>Compiling... 1>Custom Message.cpp 1>guiq.cpp 1>Generating Code...
1
2114
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 error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of...
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7184
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.