4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Need assist with Apache 404 error issue and HTML page
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 2:51 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 04, 2003 2:54 pm (20 years, 10 months ago) Reply with QuoteBack to Top

Not sure if I understand this correctly, but I think I do Smile

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.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 2:58 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 04, 2003 3:02 pm (20 years, 10 months ago) Reply with QuoteBack to Top

Ummm... so did you try what I suggested, and did it work? Question If not, what happened?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 3:07 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 04, 2003 3:08 pm (20 years, 10 months ago) Reply with QuoteBack to Top

Can you post the exact contents of the .htaccess file (with your URL removed if necessary)?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 3:13 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 04, 2003 3:22 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 3:39 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Wed Jun 04, 2003 4:02 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
jnkcowan
Junior WebHelper
Junior WebHelper


Joined: 04 Jun 2003
Posts: 6

PostPosted: Wed Jun 04, 2003 4:14 pm (20 years, 10 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by jnkcowanSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.225495 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme