Announcement

#1 2013-12-20 08:22:05

mdp
Member
2013-12-17
18

Change photo links from sections to the canonical page version

Hello,

I am looking at changing the photo urls that are being printed in various categories/albums, tags, and other sections like Most Visited, Best Rated, etc.

When you go to any category/album, tags, or other sections, you will notice that the same photo is linked using the below mentioned url format resulting in duplicate pages:-

http://localhost/photos/picture/2-photoname/category/categoryname
http://localhost/photos/picture/2-photoname/most_visited
http://localhost/photos/picture/2-photoname/best_rated
http://localhost/photos/picture/2-photoname/tags/1-tagname

The canonical link for the actual photo would be http://localhost/photos/picture/2-photoname/ and I would like that one to be crawled in search engine. Luckily each variant of the photo page also has a canonical tag such as

<link rel="canonical" href="../../../picture/2-photoname">

I want to simply print the same url format in all the above mentioned and other such sections. The url format would be the one mentioned in the Canonical link and which is the actual photo page such as:

http://localhost/photos/picture/2-photoname/

Therefore, that involves remove the ending variables like "category/categoryname" from the end.

How can I achieve this? Which files would need to be edited for the same? Any suggestions!

Offline

 

#2 2013-12-20 09:20:40

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Change photo links from sections to the canonical page version

Hello

You can take a look at include/functions_url file, but the system is really complex, I don't even understand how all works

but why to you want to achieve this ?
from my own experience most users don't care of urls at all (some even don't know what it is) and as soon as there is the "canonical" link there is not impact on SEO

Offline

 

#3 2013-12-20 09:22:08

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Change photo links from sections to the canonical page version

oh and also, this part of the url is used by Piwigo to build the navigation thumbnails on picture.php (by knowing the current section), if you remove it, you won't be able to browse the "last photos" by using them (eg: without going back to the thumbnail page each time)

Offline

 

#4 2013-12-20 13:27:38

mdp
Member
2013-12-17
18

Re: Change photo links from sections to the canonical page version

Thanks a lot. I will check it out. Another thing,

How do I change the <link rel="canonical" href="../../../picture/2-photoname"> to Absolute path?

Such as <link rel="canonical" href="http://www.domain.com/photos/picture/2-photoname">

Last edited by mdp (2013-12-20 13:27:55)

Offline

 

#5 2013-12-20 13:29:23

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Change photo links from sections to the canonical page version

it's in the header.tpl file of your theme
but once again, there is no interest to change that

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2021 · Contact