Jump to content

REDIRECT_URL vs REQUEST_URI


themistral

Recommended Posts

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  :)

Link to comment
https://forums.phpfreaks.com/topic/266868-redirect_url-vs-request_uri/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.