473,465 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

404 for .html files

I just found out that ASP.NET (1.1) does not have
generalized support for "page not found" errors.
The web.config setup for 404 errors only functions for
missing .aspx pages.

How do I configure IIS to provide 404 handling support
for a complete web site with a mixture of .aspx and
..html pages?

Thanks,
diane
Nov 19 '05 #1
8 1227
KMA
Strangely enough I hit this last night. I have the added disadvantage that I
can't configure IIS directly cos I use a host that doesn't allow it. They
*do* allow replacing their standard 404 with something else though. Could
you write a new html "official" 404.html page that redirects to My404.aspx.
Just a though; I look forward to see the real way to handle this.
"Diane Wilson" <di***@firelily.com> wrote in message
news:MPG.1d5a90545e175c18989b33@news-server...
I just found out that ASP.NET (1.1) does not have
generalized support for "page not found" errors.
The web.config setup for 404 errors only functions for
missing .aspx pages.

How do I configure IIS to provide 404 handling support
for a complete web site with a mixture of .aspx and
.html pages?

Thanks,
diane

Nov 19 '05 #2
Diane Wilson wrote:
I just found out that ASP.NET (1.1) does not have
generalized support for "page not found" errors.
The web.config setup for 404 errors only functions for
missing .aspx pages.

How do I configure IIS to provide 404 handling support
for a complete web site with a mixture of .aspx and
.html pages?

Thanks,
diane


See the "Custom Errors" tab in the properties of the site.

Hans Kesting
Nov 19 '05 #3
In article <eM**************@TK2MSFTNGP09.phx.gbl>,
ne***********@spamgourmet.com says...
Diane Wilson wrote:
I just found out that ASP.NET (1.1) does not have
generalized support for "page not found" errors.
The web.config setup for 404 errors only functions for
missing .aspx pages.

How do I configure IIS to provide 404 handling support
for a complete web site with a mixture of .aspx and
.html pages?

Thanks,
diane


See the "Custom Errors" tab in the properties of the site.


OK, thanks! that helps locally, but not on my hosting site.
(which gives me limited options for 404.html or 404.asp
but not 404.aspx -- sigh)
Diane
Nov 19 '05 #4
404.asp:

<% Response.Redirect("404.aspx") %>
-- OR --

404.html

<script>
location.replace("404.aspx");
</script>

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com

Nov 19 '05 #5
In article <11**********************@g47g2000cwa.googlegroups .com>,
ja*********@gmail.com says...
404.asp:

<% Response.Redirect("404.aspx") %>
-- OR --

404.html

<script>
location.replace("404.aspx");
</script>

Thanks! I like the .asp solution better; for things that *have*
to work, I never want to trust client-side scripts.

Diane
Nov 19 '05 #6
This helps get round the ugly bog standard message. But is there a way
to find out what the non existant page name was. I want to implement my
own 404 that looks at the non-existant page and tries to offer an
alternative. I figure most 404s come from mis-spillangs.

Diane Wilson wrote:
In article <11**********************@g47g2000cwa.googlegroups .com>,
ja*********@gmail.com says...
404.asp:

<% Response.Redirect("404.aspx") %>
-- OR --

404.html

<script>
location.replace("404.aspx");
</script>

Thanks! I like the .asp solution better; for things that *have*
to work, I never want to trust client-side scripts.

Diane

Nov 19 '05 #7
In article <42**************@coldmail.com>, cp*****@coldmail.com says...
This helps get round the ugly bog standard message. But is there a way
to find out what the non existant page name was. I want to implement my
own 404 that looks at the non-existant page and tries to offer an
alternative. I figure most 404s come from mis-spillangs.

Diane Wilson wrote:
In article <11**********************@g47g2000cwa.googlegroups .com>,
ja*********@gmail.com says...
404.asp:

<% Response.Redirect("404.aspx") %>
-- OR --

404.html

<script>
location.replace("404.aspx");
</script>


For .aspx, the HttpRequest object (Page.Request) has URL string
that was requested.

However, if you use one of the above redirect techniques, you'll only
have the page that issued the redirect. So it's necessary to have
executable logic on the first error page in the chain. If your
host lets you code a 404.asp for all 404 errors, that's where you'd
have to put the code.

If your site has its own search capability, I'd certainly put the
search field and button on whatever 404 handling page you use.

Diane
Nov 19 '05 #8
Diane Wilson wrote:
In article <42**************@coldmail.com>, cp*****@coldmail.com says...
This helps get round the ugly bog standard message. But is there a way
to find out what the non existant page name was. I want to implement my
own 404 that looks at the non-existant page and tries to offer an
alternative. I figure most 404s come from mis-spillangs.

Diane Wilson wrote:
In article <11**********************@g47g2000cwa.googlegroups .com>,
ja*********@gmail.com says...
404.asp:

<% Response.Redirect("404.aspx") %>
-- OR --

404.html

<script>
location.replace("404.aspx");
</script>

For .aspx, the HttpRequest object (Page.Request) has URL string
that was requested.

However, if you use one of the above redirect techniques, you'll only
have the page that issued the redirect. So it's necessary to have
executable logic on the first error page in the chain. If your
host lets you code a 404.asp for all 404 errors, that's where you'd
have to put the code.

If your site has its own search capability, I'd certainly put the
search field and button on whatever 404 handling page you use.

Diane


I've already got the aspx misspellings catered for. I just wondered if
there was a way to catch someone accessing the site via "abc.xyz", or
just "abc".

Unfortunately I can only replace my hosts 404b.html, so I'm a bit stuck
there. I'll certainly add a search field to my NotFound.aspx.

Still, I'm quite happy. At least the visitor never gets the standard 404
message, which was anyway in German!

Cheers.
Nov 19 '05 #9

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

Similar topics

28
by: petermichaux | last post by:
Hi, On my computer apache will see php in .php documents but not in .html documents. Can I configure apache to see php in .html documents? Or is this something that cannot be done at all? ...
2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
17
by: Don Wash | last post by:
Hi All! First of all I would like to say that VS.NET is one of the finest IDE I've used in years. It really helps me code quickly. Workspace management using auto hide windows, minimizing and...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0 data base on NT4 onto IIS on Windows 2003 Server...
59
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta...
78
by: Robert Baer | last post by:
The homepage i have had up and seemingly working is: http://oil4lessllc.com/ However, the validator has so many complaints, and being so incompetent, i have no clue as to how to fix it all. Would...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
0
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...
1
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.