ok - trying to store this in a session variable and retrieve it... driving me $^%#ing nuts. Something odd is going on with the FURLs & .htaccess ...
I call [[!GetReferrer]] at the head of my templates, which executes this [just echoing stuff now for debugging]
<?php
// get session variable for referrer id
$referringid = $_SESSION['referrerid'];
// set the current referrer it
$currentid = $modx->resource->get('id');
$_SESSION['referrerid'] = $currentid;
echo '<pre>';print_r($_SESSION);echo '</pre>';
// return the old id 'false' if not found
if($referringid){
echo 'referring id = '.$referringid;
}else{
echo 0;
}
But what it is doing is returning the pageid of the 404 file most of the time, every once in a while it will return & save the correct page ids, but nothing repeatable!! [ARGH!]
- I disabled all cache, no dice
- disabled FURLs, again no dice
- removing the .htaccess, DICE!
It works fine when the .htaccess is disabled - but I don't see anything about the .htaccess that could be causing pretty much every page to be the 404 page!
It's completely stock - the only uncommented lines are:
RewriteEngine On
RewriteBase /
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
What in the heck is going on here!?!??!