Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - How to make IIS ignore 404 errors?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to make IIS ignore 404 errors?

 Post Reply Post Reply Page  <123>
Author
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 11:23am
Are you sure you registered it in your web.config file?
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 11:40am

Yes. I added a text file with the name Default.dh, and the module handles it. It doesn't seems to handle stuff which isn't there, which means the module is only called whenever ASP.NET doesn't encounter errors. Is there a way to avoid this?

Also, whenever I have a sub which is executed at the begin of the request, and peform this code

HttpContext.Current.Response.ContentType = "text/html"

HttpContext.Current.Response.Write("Request GUID = " & Guid.NewGuid.ToString & " <br><br>")

It still displays the Default.dh file as a text file, rather than a HTML page.

EDIT It might be the cache.
EDIT2 But it wasn't =|



Edited by Diep-Vriezer
Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 12:05pm
Can you paste in the <httpHandlers> node of your web.config file in
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 12:08pm

<httpModules>

<add type="Root.Components.Security.HttpModule.HttpModule,den Heijer" name="HttpModule" />

</httpModules>

den Heijer.dll is the ouput

--

Namespace Components.Security.HttpModule

Public Class HttpModule

Implements IHttpModule

Public Sub Dispose() Implements System.Web.IHttpModule.Dispose

End Sub

Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init

AddHandler context.BeginRequest, AddressOf Me.BeginRequest

End Sub

Private Sub BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)

HttpContext.Current.Response.ContentType = "text/html"

HttpContext.Current.Response.Write("Request GUID = " & Guid.NewGuid.ToString & " <br><br>")

End Sub

End Class

End Namespace

Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 12:13pm
Try this:

<httpHandlers>
   <add verb="*" path="*.dh" type="Root.Components.Security.HttpModule.HttpModule, den Heijer" />
   </httpHandlers>
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 12:44pm
Altough it worked  Thanks! I still don't understand why that module wouldn't work.. Anyway, I set the path to path="*.*" and it will handle pretty much everything.
Gone..
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 1:38pm

Erm, now I have all the extentions handled by that one module, including the .aspx pages

If I would create a new <add verb="*" path="*.aspx" what type="" would I need if I want them to be handled by the original ASP.NET handler?

Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2004 at 2:42pm
From my Machine.config file:

<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory"/>
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.