Jump to content

Cool Deed

Retired Forum Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Cool Deed

  1. Hi All, I hope everyone is well. So I enabled Full Friendly URLs, but Google reports many duplicate content in Search Console. For eg. https://mydomain.com and https://mydomain.com/index.php have the same content. https://mydomain.com/login and https://mydomain.com/index.php/login and many others. My question is, Is there a way to prevent the duplicate content issue with Google by removing index.php from URLs when Full Friendly URLs are enabled? I must note that I have a hook file that helps make links canonical and is pasted below: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook('ClientAreaHeadOutput', 1, function($vars) { $SystemURL = 'https://mydomain.com'; $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = strtok($url, '?'); return <<<HTML <link rel="canonical" href="{$url}"/> HTML; }); Thank you. Kind regards.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated