CodeIgniter Forums

Full Version: Canonical Links Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
I have setup cdn for the website and now I am hacing canonical links issues. cdn.domain.com is being indexed which contains content of the main domain so the Google is considering it as duplicate content. I would like to place a canonical link element on the header.php so it shows up on every page but I am having difficulties as I am very new with codeignitor. To make it more clear I have mentione the codes below for getting links.

Home Page:
Code:
<?php echo base_url();?>

Other static pages like about, contact, privacy policy, etc.:
Code:
<?php echo base_url();?>info/<?php echo $footer_menu_row->page_seo; ?>.html

For dynamic pages (Similar to blog posts):
Code:
<?php echo base_url().'view/'.$row->wall_id.'/'.friendlyURL($row->wall_name).'.html';?>

Thanks

El Forum

[eluser]boltsabre[/eluser]
Hmmm, I cannot see any "canonical" related html at all...

As to the best of my knowledge canonical links are strictly one domain, not cross domain, directives. I could be wrong, but I think you'll have to look for another option.

El Forum

[eluser]Unknown[/eluser]
@boltsabre

I just want to echo out actual url of the current page. Example: When someone visits domain.com/info/about-us.php then in the header it should have
Code:
<link rel="canonical" href="http://domain.com/info/about-us.php" />
so Google does not consider it as duplicate when google finds cdn version http://cdn.domain.com/info/about-us.php