Canonical URLs

From Adult Web Scripts Wiki

Jump to: navigation, search

The canonical URL should be the url that matched the current url config rule - minus any spurious query args that might be appended:

  • {$URL.urlconfig_name} is the current rule name
  • {$URL.args} are the current attributes decoded from the url

so we re-encode the url using {url_encode} using the special arg _args to pass an array of values:

{url_encode urlconfig_name=$URL.urlconfig_name _args=$URL.args}

So then this should go in the html header:

<link rel="canonical" href="{url_encode urlconfig_name=$URL.urlconfig_name _args=$URL.args}
" />