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

Custom 404 Page

I notice that when you have the defualt setup of 404 error
pages the IIS 5.0 log tracks the page the user was trying
to get to and the page they where at when they tryed to
get to the now missing page. I recently wrote my own 404
error page to make it match my site but when I set IIS to
use my custom page it no longer traks the page that the
user was trying to get. I was told I needed to add some
code to my page to fix this, but I don't know what code to
add. Can someone tell me? (I am useing ASP on the custom
404 error page) I am returning a 404 error response,
everything works fine it is just that IIS does not log
what page the user was trying to get to.

Jul 19 '05 #1
6 1398
IPT
Make sure your 404 custom page is .asp and inside you script, you use this
code:
Response.Write Request.ServerVariables("HTTP_REFERER")

This should work.
"Matt" <an*******@discussions.microsoft.com> wrote in message
news:1e*****************************@phx.gbl...
I notice that when you have the defualt setup of 404 error
pages the IIS 5.0 log tracks the page the user was trying
to get to and the page they where at when they tryed to
get to the now missing page. I recently wrote my own 404
error page to make it match my site but when I set IIS to
use my custom page it no longer traks the page that the
user was trying to get. I was told I needed to add some
code to my page to fix this, but I don't know what code to
add. Can someone tell me? (I am useing ASP on the custom
404 error page) I am returning a 404 error response,
everything works fine it is just that IIS does not log
what page the user was trying to get to.

Jul 19 '05 #2
http://www.aspfaq.com/2162

--
http://www.aspfaq.com/
(Reverse address to reply.)

"Matt" <an*******@discussions.microsoft.com> wrote in message
news:1e*****************************@phx.gbl...
I notice that when you have the defualt setup of 404 error
pages the IIS 5.0 log tracks the page the user was trying
to get to and the page they where at when they tryed to
get to the now missing page. I recently wrote my own 404
error page to make it match my site but when I set IIS to
use my custom page it no longer traks the page that the
user was trying to get. I was told I needed to add some
code to my page to fix this, but I don't know what code to
add. Can someone tell me? (I am useing ASP on the custom
404 error page) I am returning a 404 error response,
everything works fine it is just that IIS does not log
what page the user was trying to get to.

Jul 19 '05 #3
It is a .asp page and a response.write writes info to the
screen, I need it written to the server log.
-----Original Message-----
Make sure your 404 custom page is .asp and inside you script, you use thiscode:
Response.Write Request.ServerVariables("HTTP_REFERER")

This should work.
"Matt" <an*******@discussions.microsoft.com> wrote in messagenews:1e*****************************@phx.gbl...
I notice that when you have the defualt setup of 404 error pages the IIS 5.0 log tracks the page the user was trying to get to and the page they where at when they tryed to
get to the now missing page. I recently wrote my own 404
error page to make it match my site but when I set IIS to use my custom page it no longer traks the page that the
user was trying to get. I was told I needed to add some
code to my page to fix this, but I don't know what code to add. Can someone tell me? (I am useing ASP on the custom
404 error page) I am returning a 404 error response,
everything works fine it is just that IIS does not log
what page the user was trying to get to.

.

Jul 19 '05 #4
That FAQ has nothing to do with written information to the
log. That just the info to the web page, I need the log
-----Original Message-----
http://www.aspfaq.com/2162

--
http://www.aspfaq.com/
(Reverse address to reply.)

"Matt" <an*******@discussions.microsoft.com> wrote in messagenews:1e*****************************@phx.gbl...
I notice that when you have the defualt setup of 404 error pages the IIS 5.0 log tracks the page the user was trying to get to and the page they where at when they tryed to
get to the now missing page. I recently wrote my own 404
error page to make it match my site but when I set IIS to use my custom page it no longer traks the page that the
user was trying to get. I was told I needed to add some
code to my page to fix this, but I don't know what code to add. Can someone tell me? (I am useing ASP on the custom
404 error page) I am returning a 404 error response,
everything works fine it is just that IIS does not log
what page the user was trying to get to.

.

Jul 19 '05 #5
> That FAQ has nothing to do with written information to the
log.


You seemed to talk a lot about 404 and very little about the log. You will
need extended permissions to write to the event log from ASP (why not just
keep your own log, like the article does)?

http://groups.google.com/groups?q=gr...rite+event+log

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #6
I talked about both things, if you read my post you will
see I tell you how my 404 \page is being done (using ASP
and returning a 404 error rsponse) and that the issues is
some info is not being written to the log. I can't keep my
own log since my web site stats porgame reads from the iis
log. I looked at the link you gave me but it talks about
writting to the event log using com objects, axtivex
controlls, and full VB code none of which I know. Plus I
need to write to the IIS log not the windows event log
(which, from what my host tells me, are two differant
things). Can you tell me how to write to the IIS log the
information I am missing (the page the user was trying to
get to when they got the 404 error)
-----Original Message-----
That FAQ has nothing to do with written information to the log.
You seemed to talk a lot about 404 and very little about

the log. You willneed extended permissions to write to the event log from ASP (why not justkeep your own log, like the article does)?

http://groups.google.com/groups?q=group% 3A*asp*+write+event+log
--
http://www.aspfaq.com/
(Reverse address to reply.)
.

Jul 19 '05 #7

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

Similar topics

1
by: MacDermott | last post by:
I created a report to print labels, and it created a custom page size for the report. When I opened the properties of the printer driver I could see it listed - as Custom. Then I had to change...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
9
by: Nick | last post by:
the customError feature is not working. I have it setup as the help says in my web.config file. <customErrors defaultRedirect="DsAppError.aspx" mode="RemoteOnly"/> I tried in a couple...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
6
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
1
by: Mutley | last post by:
Hi, I have written an HttpHandler to process page requests for a custom file extension. The handler gets called as expected and after searching the web for examples I have used a method called...
4
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying...
2
by: Michal Valent | last post by:
I would like to fire some custom server control event before Page_Load event like this (from the trace of an aspx page) : Trace Information Category Message From First(s) From Last(s) aspx.page...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
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,...

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.