apache 404 redirect and php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gintonic
Forum Newbie
Posts: 1
Joined: Tue Aug 06, 2002 2:17 am

apache 404 redirect and php

Post by gintonic »

My Apache 404 error page contains a php part (redirected with .htaccess)
The only output I wanna have is the url, that caused the error. My code only works with Mac IE 5, I don't understand it, I've always thought php was server side??
I'm using the rather old php version 3.0.16....

that's my error-file code:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php

echo("$HTTP_REFERER");

?>
</body>
</html>


any help :-) ??
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

php manual wrote:'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
The user agent being the browser so this is really a client side issue. Unfortunately whether it works or not is dependent on which browser a user is using and how they have it configured.

Mac
Post Reply