Hello,
I'm trying to get a FURL redirect working with one of my CMPs but it's not sending any params to the landing page.
My plugin which is set to OnPageNotFound. It does redirect fine so it is working but it's not sending the GET param to the next page. In the snippet on the next page, return $_GET['option1']; does not display anything. Funny thing is, this plugin works on the same server on a different domain... I've copied it over exactly and it's not working! Anyone able to help?
<?php
$context = $modx->context->get('key');
if($context == 'web'){
$ResourceID = 60;
$list = $modx->getService('list','List',$modx->getOption('list.core_path',null,$modx->getOption('core_path').'components/list/').'model/list/',$scriptProperties);
if (!($list instanceof List)) return '';
$search = $_SERVER['REQUEST_URI'];
$base_url = $modx->getOption('base_url');
if ($base_url != '/') {
$search = str_replace($base_url,'',$search);
}
$search = trim($search, '/');
$params = explode('/', $search);
$title = urldecode($params[2]);
// url is similar to mysite.com/listing/list/article+3
$c = $modx->newQuery('listDetail');
$c->where(array(
'active' => true,
'title' => $title,
));
$articles = $modx->getCollection('listDetail', $c);
foreach($articles as $article){
$_GET['option1'] = $article->get('option1');
$modx->sendForward($ResourceID);
return;
}
}