themistral Posted August 9, 2012 Share Posted August 9, 2012 Hi guys, I'm having a strange problem. I'm working on somebody else's website and they track every page that is visited for their own records, using their own script. Fine. The script currently uses $_SERVER['REDIRECT_URL'] and records everything fine. Each page is dynamically generated so the pages do not physically exist on the server. The problem comes with a custom 404 page. Currently, the htaccess is set to redirect back to the homepage if the page is not found. I have setup a custom 404 page and changed the htaccess file to reflect that, and even when the website is showing a valid page, the tracker records it as the custom 404 page. I tried changing the tracking script to use $_SERVER['REQUEST_URI'] but the same is still happening. Can anyone shed any light on why a page might be showing correctly to the user, but the webserver thinks the request is generating a 404 error? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/266868-redirect_url-vs-request_uri/ Share on other sites More sharing options...
darkfreaks Posted August 9, 2012 Share Posted August 9, 2012 have you tried $_SERVER['REDIRECT_URL']; Quote Link to comment https://forums.phpfreaks.com/topic/266868-redirect_url-vs-request_uri/#findComment-1368161 Share on other sites More sharing options...
themistral Posted August 16, 2012 Author Share Posted August 16, 2012 Yes - that's what was being used before which is why I tested $_SERVER['REQUEST_URI'] Quote Link to comment https://forums.phpfreaks.com/topic/266868-redirect_url-vs-request_uri/#findComment-1369861 Share on other sites More sharing options...
PeoMachine Posted August 17, 2012 Share Posted August 17, 2012 Post your htaccess. Maybe the problem is with him. Quote Link to comment https://forums.phpfreaks.com/topic/266868-redirect_url-vs-request_uri/#findComment-1370223 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.