Author Topic: Canonical URL mod (SEO)  (Read 4650 times)

0 Members and 1 Guest are viewing this topic.

Offline jeyjoo

  • Newbie
  • *
  • Posts: 46
  • Jeyjoo Web Design
    • View Profile
    • Sheffield Web Design
Canonical URL mod (SEO)
« on: August 29, 2011, 03:05:37 PM »
Does anyone know of if there is a canonical URL mod.

Each image in my gallery can have at least 2 URLs depending on whether it came through search results or not. For example, the following URLs refer to the same image:

http://www.jeyjoo.com/gallery/img254.search.htm
http://www.jeyjoo.com/gallery/img-green-spider-on-red-strawberry-254.htm

To counter this I want to add a canonical URL in the head section of my each page - of the form:

<link rel="canonical" href="http://www.jeyjoo.com/gallery/img-green-spider-on-red-strawberry-254.htm" />


The canonical link is supported by Google, and tells asearch angine which of the mutliple URLs to give importance to (link juice).

Does anyone know of a mod for this.

Much appreciated
Jeyjoo - kick ass web design, SEO and online marketing packages.

http://www.jeyjoo.com/gallery/ - free stock images (a 4images gallery)  |
http://www.jeyjoo.com - Sheffield web design  |  http://www.jeyjoo.com - Sheffield SEO  |  http://it.jeyjoo.com - Web Design Milano  |  http://it.jeyjoo.com - SEO Italiano

Offline khansahib

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Canonical URL mod (SEO)
« Reply #1 on: August 30, 2011, 09:34:45 AM »
well i have done it by putting the file code in my php based header.php file.

	
 if(isset(
$_GET['page'])) {
	
	
$url substr($_SERVER['REQUEST_URI'], 0strpos($_SERVER['REQUEST_URI'], '?') );
	
	
echo 
'<link rel="canonical" href="http://www.yoursite.com' $url '" />';
	
 }


you can modify the

if(isset($_GET['page']

part and replace page with img
« Last Edit: August 30, 2011, 09:50:44 AM by khansahib »

Offline popac

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: Canonical URL mod (SEO)
« Reply #2 on: September 28, 2011, 03:12:27 PM »