having installed the News and CGBlog Module, I have plenty of URLs like:
Code: Select all
.../index.php?mact=CGBlog,me9d1a,default,1&me9d1apagelimit=10&me9d1apagenumber=6&me9d1areturnid=1&page=1
Code: Select all
//UDT CODE for "noindex_on_mact_urls"
if (substr($_SERVER['QUERY_STRING'], 0, 5 ) === "mact="){
$noindexurl = 'true';
$smarty->assign('noindexurl', $noindexurl);
}
In the global settings -> global metadata, I've inserted this snippet:
Code: Select all
{if ((isset($noindexurl) && $noindexurl =='true'))}
{*via UDT "noindex_on_mact_urls"*}
<meta name="robots" content="noindex, follow">
{else}
<meta name="robots" content="index, follow">
{/if}

This approach works quite well, but is there a more elegant way to do this?