0

Google is indexing my news articles as:

https://www.site.com/news/id5-

and:

https://www.site.com/news/id5-title-of-article

In fact, it indexes both, but omits the full URL version in results. Both URLs resolve to the same address, but I want to force id#-title-of-article each time to fix this canonicalization issue.

The site is written using Codeignigter framework.

My routes file at system/application/config/routes.php contains:

$route['news/id(\d+)-(.*)'] = "news/view/$1";

Any ideas on how i can fix this?

1 Answers1

0

On your header, let Google know what the common URL should be.

<link rel="canonical" href="https://www.site.com/news/id5-title-of-article" />

Make sure that this is available regardless of which page is loaded. It will take some time to re-index, but Google will only show this link on its search once indexed.

dakdad
  • 2,947
  • 2
  • 22
  • 21
  • Thank you for your solution. Is there no other option? I ask because when I have have 700 news articles, it will be impossible/inefficient to add this code to all pages of my site? – user2034285 Feb 02 '13 at 13:45
  • Based on the question (because it involves an ID) I thought your site is dynamically generated. Regardless of the number of the articles, it would be a single location (one line of code, perhaps) that you would need to update to generate this canonical tag. – dakdad Feb 04 '13 at 04:38
  • Using your advice, I thought adding something similar to the following bit of code would allow me to specify the canonical of pages within NEWS. " /> } ?> The problem is that I don't know how to go about specifying that ONLY IF $currentpage is */news/id#-title, return – user2034285 Feb 05 '13 at 14:58