Generic Canonical Tag Plug & Play


<?php
$canonical = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo '<link rel="canonical" href="'.$canonical.'">';
?>

Canonical Tag Without Parameter


<?php
$canonical = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$noParamsCanonical = strtok($canonical, '?');
echo '<link rel="canonical" href="'.$noParamsCanonical.'">';
?>
Want a Fast Server Like Mine?

GET VULTR!