Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Custom 404
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom 404

 Post Reply Post Reply
Author
dwhite02 View Drop Down
Newbie
Newbie


Joined: 10 October 2004
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote dwhite02 Quote  Post ReplyReply Direct Link To This Post Topic: Custom 404
    Posted: 26 January 2008 at 1:03am
I'm working on a custom 404 which provides suggested links based on the page being sought.
 
My question is in 2 parts:
 
1. When I try and set an ASP page to be a custom 404, the html appears as text on the rendered page. Why is this and can I fix this. Is it possible to have an ASP page as a custom 404. Web Server is IIS6. I wanted to suggest links (sourced from a DB) based on the page address causing the 404 <% =( "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") )%>.
 
2. Whilst working around the problem mentioned above, I have made a .htm page the custom 404 and am using it to manually link to the ASP page to list possible suggested links (sourced from a DB) based on the referer <% = request.ServerVariables("HTTP_REFERER") %>. This introduces another click. I have tried used a meta tag refresh and seperately a javascript redirect to get the .htm page to take you to the ASP page, but the referer is not included. Is there a way around this. Will a response.redirect achieve this?
 
Hope someone can help with either/both problem(s).
 
Cheers.
 
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2008 at 3:26pm
Why shouldn't you be able to use an asp page? Simply change the custom error page in IIS. Doing that all the time.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2008 at 6:08pm
You can use ASP files as 404 pages, you need to select the type as a URL then point it to your 404 ASP page, eg:-

/HTTPerrors/404page.asp

We use one on our main www.webwiz.net site (have a go if you like).

Beceuase we had a big site change recently the 404 ASP page gets the 404 URL and then if the page has moved redirects based on that URL, if it's not a moved page it shows a sheach form.

You could use the same thing to get the URL for your search, the code below is what we use to get the URL that was a 404:-

'Get the 404 page
str404Page = Request.ServerVariables("Query_String")

'Chop out the crap we don't want
str404Page = LCase(Mid(str404Page, InStr(str404Page, ":80/") + 3, Len(str404Page)))


Back to Top
 Post Reply Post Reply

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.