Author |
Message |
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 2:51 pm (21 years, 6 months ago) |
|
We are running an Apache server and use a customized 404 error page, much as described in:
http://www.bignosebird.com/apache/a7.shtml
The problew we have is owing to our Firewall we do not use web server logging for traffic analysis. We use IBM Surf-Aid. The Apache server, when it serves up our custom 404 page, does not change the URL that yielded the error code.
I.E., If you were to enter www.oursite.com/car.html (and there is no such page, the 404 error page appears, however the URL in the address br remains www.oursite.com/car.html.
I would like it to change to a single URL that would be the same for every 404 error and still display the custom page. This is because the Surf-Aid requires JavaScript in the HTML of a page to track it, thus the need for the custom 404 error page. We also need a fixed URL so we can count the times the page appears.
So, is it possible to use a custom 404 error page as described (we will also do this for other 400/500 errors) and have the same URL appear, replacing the one that generated the error code in the first place?
Thanks,
Joseph Cowan
jnkcowan@msn.com |
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Jun 04, 2003 2:54 pm (21 years, 6 months ago) |
|
Not sure if I understand this correctly, but I think I do
Just replace
Code: | ErrorDocument 404 /missing.html |
with Code: | ErrorDocument 404 http://www.yoursite.com/missing.html |
Basically you're replacing a relative path with an absolute path, so Apache will forward visitors to the URL you give instead of just showing them the 404 error page without a redirection. |
________________________________
|
|
|
|
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 2:58 pm (21 years, 6 months ago) |
|
using the relative path: ErrorDocument 404/missing.html, the 404 page shows up but in the address window the url remains www.oursite.com/car.html and that is what the javascript reports to Surf-Aid. I can get them to see the 404 page (the customer) but I need the address window to change to a common URL for all instances of the 404 error so I can as Surf-Aid to tell me stats about the page. |
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Jun 04, 2003 3:02 pm (21 years, 6 months ago) |
|
Ummm... so did you try what I suggested, and did it work? If not, what happened? |
________________________________
|
|
|
|
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 3:07 pm (21 years, 6 months ago) |
|
The same thing occurs. The 404 page shows up, but the Address URL in the browser remains whatever was entered to produce the error.
If you enter www.oursite.com/car.html
or www.oursite.com/crash.html
that is what the address remains after the 404 page appears. |
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Jun 04, 2003 3:08 pm (21 years, 6 months ago) |
|
Can you post the exact contents of the .htaccess file (with your URL removed if necessary)? |
________________________________
|
|
|
|
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 3:13 pm (21 years, 6 months ago) |
|
I don't have access to it & our WebMaster is swamped, it took a lot to get the last change. I was hoping that out there someone had Surf-Aid or EbTrendsLive & Apache and had dealt with this issue before.
From what I've been told the sections regarding the error codes, it looks just like the sample given in my 1st email
Code: | ErrorDocument 404 /error404.html |
|
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Jun 04, 2003 3:22 pm (21 years, 6 months ago) |
|
Well if it looks like that then what has been changed?? The whole point is to add http://www.yoursite.com before the name of the 404 error page. |
________________________________
|
|
|
|
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 3:39 pm (21 years, 6 months ago) |
|
I apologize, I meant the original, adding the absolute path points at the same file with the same result, the file appears, however the URL in the address remains the same. So If we have 3000 different Error 404's we get 3000 different URLs. We really want to query Surf-Aid, "How many Error 404's did we get & what was the prior page?" And we need it to display a single URL to do so. |
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Wed Jun 04, 2003 4:02 pm (21 years, 6 months ago) |
|
you say you're using javascript? I don't know much about javascript, but doing something like this in the 404 page before your current script runs should work:
Code: | if(window.location != "http://www.site.com/404.html") {
window.location = "http://www.site.com/404.html";
}else{
(whatever code will execute your script)
} |
|
________________________________ It's turtles all the way down... |
|
|
|
jnkcowan
Junior WebHelper
Joined: 04 Jun 2003
Posts: 6
|
Posted:
Wed Jun 04, 2003 4:14 pm (21 years, 6 months ago) |
|
What we are trying is something both the Webmaster & I came up with separately.
Customer enters weong page URL
Apache points at error page (which shows the same URL, unfortunately)
That page actually then redirects to a fixed page we call error404.html, this address is now displayed in the URL window, captured by the Surf-Aid JavaScript & lets us count the errors, and we can chack back on the path to see the referring URL which caused the error.
Thanks for your help. |
________________________________ J F Cowan
Ubiquity Analytics
jnkcowan@msn.com |
|
|
|
|