cthonus Posted April 13, 2007 Share Posted April 13, 2007 Been trying to figure this one out most of the evening. My .htaccess file contains "ErrorDocument 404 /404.php" The php code on the 404 page is simply <?php echo $REQUEST_URI ?> followed by some standard blurb. This always returns "/404.php" regardless of what I type into the address bar. Any help gratefully received. Quote Link to comment https://forums.phpfreaks.com/topic/46941-solved-request_uri-always-returns-404php/ Share on other sites More sharing options...
MadTechie Posted April 14, 2007 Share Posted April 14, 2007 <?php echo $REQUEST_URI ?> will print "/404.php" as you are on that page!! try <?php echo $_SERVER['HTTP_REFERER'] ?> Quote Link to comment https://forums.phpfreaks.com/topic/46941-solved-request_uri-always-returns-404php/#findComment-228924 Share on other sites More sharing options...
cthonus Posted April 14, 2007 Author Share Posted April 14, 2007 Hrm. That returned blank. Have done a phpinfo() list and see the variable I need appears to be $DOCUMENT_URI. In my ignorance I assumed such things would be more or less standardised in php though I guess that because it's a server variable it's down to each installation... Thank you so much for your quick response though! Much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/46941-solved-request_uri-always-returns-404php/#findComment-229096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.