Welcome Guest, Not a member yet? Register   Sign In
I can access to one site by few different URLs
#4

(09-20-2019, 06:21 AM)mk27 Wrote:
(09-20-2019, 05:51 AM)John_Betong Wrote: Try this link and read the Google recommendations:


https://support.google.com/webmasters/an...9066?hl=en

Thanks! Thats interesting, and im a little less afraid now, but if you know how to redirect those pages to main, defined route, I would appreciate it.

I pass the required Controller's $data['canonical'] to the view and echo $canonical
PHP Code:
// Controller
$data['canonical']  strtolower($this->uri->uri_string()); // 'quotations';

// View
<link rel="canonical" href="<?= base_url($canonical); ?> "

The above script has not been tested but you should get the general idea. It depends if you are using "Pretty Urls" or just index.php.

Try the script and test it with all URL variations. the canonical link should be identical in every case.
Reply


Messages In This Thread
RE: I can access to one site by few different URLs - by John_Betong - 09-20-2019, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB