|Canonical link element in sitemap or htaccess|
Please excuse my ignorance.
I'm trying to tweak some things on my site, and am wanting to add the rel=canonical tag to some pages .. the problem is those pages are designed in a template and dynamic program (coppermine gallery) and I can't see how to write a meta tag in the head of an individual page .. jus the main template, which would write that tag on all pages .. thousands of them .. so that won't work .. so I thought it's possible to write a rel=canonical tag in either the site map or the htaccess file, is that correct? Any assistance on how to do this would be MUCH appreciated.
Thanks in advance.
It is possible to support canonical link element by returning the information in HTTP headers, which can be done via .htaccess or via server side script. For more details see our past discussion:
Google Offers Canonical Support in the HTTP Header
You cannot set rel canonical explicitly via sitemap.xml.
Thanks. I guess part of the questions then, is how identical do the 2 pages have to be? And is there not any easy automated solution to doing something like this with, say, a stock photography site .. where I have maybe 10 pages of very similar images ... but they're not identical .. the text on the pages will be pretty much the same thing .. captions and titles and keywords etc .. is that something worth spending the time on trying to (a) figure out how to do it and (b) manually adding htaccess stuff to tell google what to prioritize?
Lastly, what exactly do I put in the .htaccess file (I don't know anything about server side scripts, etc) to tell google to prioritize page 1a over page 1b?
Thanks so much,
priority implies a scale or weight and the best answer wins.
canonical means "the standard form" which implies there is only one.
if the page is about the photograph and the photograph on that page is unique, then that page should have its own canonical url.
the fact that your text on that page is not unique or descriptive enough is a separate issue.
the technical solution to that might be the meta robots noindex rather than the link rel canonical.
or perhaps these pages could link back to a page about the collection of photographs and work on getting that page noticed.
speaking of which, you might also consider using sequential link types:
Ahh, thanks. So it's not canonical then.
The problem with text on the page being unique/descriptive is most of the text is taken from image IPTC date .. entered using programs that automate that process .. doing each one individually would be impossible for hundreds and hundreds, thousands, of images. And even so, there's only so many ways one can caption an image of a bear eating a fish. or sleeping. Or the northern lights over a mountain, and so on.
I'm switching to using wordpress to display small collections of images in a gallery, and each clicks thru to its own url/page .. and then using copper mine gallery to host and collate the entire albums of images .. what I want to do is tell the google that the wordpress gallery is the one that I want to prioritize .. or, well, at least that I don't want to be penalized for having duplicate content in another part of my site. And so the same image might be hosted and displayed on 2 separate urls ... on win the copper mine section, and one in the w/p section.
I'm probably overthinking it and worrying about stuff that doesn't really matter. I just know that my coppermine galleries have gone WAY down in the last 12-18 months on search results. yet they're all optimized reasonably well and I have no idea what the penalty is for.
Thanks; I hadn't seen that sequential link type before. Cool.
assuming i understand your description properly, you want to index the WP galleries and one of the WP urls per-image for the image pages.
the coppermine galleries should probably be noindex,followed or if they are the same collections you could use the link rel canonical for each equivalent CM/WP gallery pair.
the individual CM image pages should link rel canonical to the equivalent WP image page url.
|entered using programs that automate that process .. doing each one individually would be impossible for hundreds and hundreds, thousands, of images. |
i wouldn't expect to see quality content using automated content generation techniques.
thin content and template-heavy sites were much of the focus for panda.
in order for you to expect a specific page to show up in a search result, you must provide a reason for that page to stand out among all of your own content for that search - and then it also has to stand out among your competition for that search.
The copper mine galleries do bring me some traffic ... and I don't think I would want them completely noindex'ed .. they're useful for when someone does a very specific search .. rare, but those are often searches that actually sell better.
So I'm not really sure of the best structure for all of it. Maybe just retweak and refine the selection process of what goes in the wordpress section and what is added to both. That would be a pretty monumental task.
Stock photography isn't all about "quality content" .. it's often as much about having what a particular person wants, when they want it, and having it where they can find it. I can re-edit all my albums and galleries to a handful of standout images, but as often as not an editor isn't looking for a 'standout' image, they're looking for an image that fits the particular story they need it to accompany. So having volume is important.
I'd use wordpress alone, but it doesn't serve the function of stock images and searching and keywording and so forth that coppermine does. But google seems to love wordpress much more than it does copper mine.
I do appreciate the input, thanks.
you probably need an internal search function that is specific to your visitors' requirements.
Possibly, but that's way beyond anything I know how to do. :)
Oh and I meant to add .. if I could write those rel=canonical tags for the cog pages that duplicate a wordpress page, that would be fine .. but those pages are generated dynamically from a template, and I don' know how to code a field that would allow me to put a tag like that in a header of one page, without it going into all the pages. Which brings me full circle, I guess .. that's why I was asking about putting in a site map or how to write it into a htaccess file.
If I want to tell google to prioritize, say,
instead of this page
how do I do that via htaccess .. and should that go in a htaccess file in the root directory, or in the directory of the one I want to point away from? (i.e., in the ôstock? directory?
Thanks so much.
[edited by: aakk9999 at 10:53 pm (utc) on Nov 13, 2013]
[edit reason] Unlinked sample URLs - please use example.com as it remains unlinked [/edit]
|Possibly, but that's way beyond anything I know how to do. |
As long as the pages are indexed, you can always throw in a custom g### search. If you let them show ads, it's free.
on-site, you have to do that with information architecture, not technology.
the two examples you gave are not canonical equivalents.
|code a field that would allow me to put a tag like that in a header of one page, without it going into all the pages |
it's the same problem, whether you solve it with an HTTP Response header or in the header of the HTML document.
|If I want to tell google to prioritize, say, |
instead of this page
how do I do that via htaccess
This is one of the few cases I'd say it's easier/simpler to do via XML Sitemap inclusion/exclusion on your end.
The way to canonicalize via XML Sitemap, for Google, is to include the URLs you would like them to consider as the canonical in an XML Sitemap while omitting the "near duplicates" produced by copper mine from the XML Sitemap you present to them.
|Indicate your canonical (preferred) URLs by including them in a Sitemap |
Pick a canonical (preferred) URL for each of your product pages, and tell us about your preference by submitting these canonical URLs in a Sitemap.
We don't guarantee that we'll use the URLs you submit in a Sitemap, but submitting one is a useful way to tell Google about the pages on your site you consider most important.
Thanks folks. Phranque, you're saying that canonical pages have to be exactly the same, not just similar, correct?
I'll try that solution, JD ... it'd be nice if Google would suggest doing things that that CAN assure us works a particular way .. I've already spent WAY too much time trying things out that get suggested only to find google don't care about it later.