if ($modx->documentIdentifier == $modx->config['error_page'])
$TVname = 'oldURI';
$current = $_SERVER["REQUEST_URI"];
$tmplvars = $modx->getFullTableName("site_tmplvars");
$contentvalues = $modx->getFullTableName("site_tmplvar_contentvalues");
$docQuery = $modx->db->query("SELECT contentid FROM $tmplvars INNER JOIN $contentvalues ON $tmplvars.id = $contentvalues.tmplvarid WHERE $tmplvars.name = '$TVname' AND $contentvalues.value = '$current'");
if ($modx->db->getRecordCount($docQuery) > 0) {
$docRow = $modx->db->getRow($docQuery);
$id = $docRow['contentid'];
$url = $modx->makeUrl($id, '', '', 'full');
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url");
break;
}
I’m no PHP expert, but I assume there’s probably a function call in PHP to access querystring parameters?$_GET[’pageid’]
This discussion is closed to further replies. Keep calm and carry on.