Forum Moderators: phranque

Message Too Old, No Replies

how mod rewrite affects HTTP REFERER

HTTP_REFERER and basename

         

jeffz2009

5:17 pm on Oct 24, 2009 (gmt 0)

10+ Year Member



without mod: [anydomain.co.uk...]
with mod: [anydomain.co.uk...]

will I be able to dig out from HTTP_REFERER users.php? (eg. using basename) once rewrite_mod is used?

jdMorgan

5:38 pm on Oct 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're going to have to be more specific here, as it's impossible to say without seeing the rule that you're asking about...

Jim

TheMadScientist

10:47 pm on Oct 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure if I'm understanding the question, because I keep thinking <?php echo $_SERVER['HTTP_REFERER']; ?> will tell you the answer to your question... If you echo out $_SERVER['HTTP_REFERER']; at the top of the https://www.anydomain.co.uk/admin/Smith page, you'll see exactly what you have to work with... Either it's there or it's not.

g1smd

8:01 am on Oct 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Many browsers resend the original referrer data when responding to a redirect.

Some firewall and internet security software strips all referrer data from information sent to a server.

Searchengines don't send referrer data because they don't immediately follow the redirect. They make a note of the redirected URL and crawl it later from their list of URLs to crawl.

Referrer data cannot be relied on all that much.

jeffz2009

2:26 pm on Oct 25, 2009 (gmt 0)

10+ Year Member



I think I mixed two things up ... pains of learning.
I guess I mixed up browser's location bar content and HTTP_REFERER contained in GLOBALS.

g1smd

7:28 pm on Oct 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Browser URL bar shows the last URL that the browser asked the server to serve.

TheMadScientist

8:51 pm on Oct 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you're rewriting back to /admin/users.php?user=Smith then <?php print_r($_GET); echo "<br /><br />".$_SERVER['QUERY_STRING'] ?> should give you some ideas...

(You must be rewriting or planning to for it to work at all, so the answer is, as long as you pass the QUERY_STRING you need to the actual location of the file you are running to generate the output for the new 'friendly' URL, then yes, you will be able to get the correct QUERY_STRING to your script, and can even put it together the same way in a Mod_Rewrite Environmental Variable if you need it there.)

If you are not rewriting yet, you will need to and the process can get a bit complicated, but there are tutorials in the Library, including this one: [webmasterworld.com...] on how to do it.

Hope this one is actually some help.

BTW: We all seems to have forgotten our manners...
Welcome to WebmasterWorld!