-
-
Save evandrocoan/e3e6d8024420339863f2dae2751f67c9 to your computer and use it in GitHub Desktop.
Generate a canonical URL using PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "http://domainname.com{$_SERVER['SCRIPT_NAME']}"; | |
echo "<link rel='canonical' href=$url>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-->