How to set Canonical HTTP headers for cross-domain html to html?

I have two sites, one old, one new. The old one is not updated with new content but the new one uses reviews and other content that is naturally enough regarded by Google as duplicate content, so I want to either 301 the old site or rel=canonical to the new site…

… but the old site is an old CMS and the meta fields are keywords, description, and that’a about it and I don’t think I have a way of writing between the <head> tags.

I’m not sure I want to kill off the old site with a 301, so I’d like to set canonical links in htaccess, but typically htaccess is used for .pdf to html domain links and not cross domain html to html, so I can’t find a How To.

Any help welcome, thanks.

Canonicalization has nothing to do with one site to another. It’s has to do with multiple ways of navigating to a site. My write up here explains it all. http://www.websitecodetutorials.com/code/htaccess/canonicalization-htaccess-mod_rewrite-301-redirect-non-www-to-www-and-index-to-folder.php. If you want a 301 redirect its under htaccess in my site

Hi Eric

Cross site canonicalisation is observed by Google.

//youtu.be/zI6L2N4A0hA

I think I need a version of the HTTP code from this blog post “How To: Advanced rel=“canonical” HTTP Headers”

//youtu.be/O8drPXudZZc

This is how to do a pdf to html rel=canonical in htaccess (I think).

<FilesMatch “my-file.pdf”>
Header set Link ‘<http://makeitrank.com>; rel=”canonical”‘
</FilesMatch>

But I expect I would need to change “filesmatch” to something else…?

The tag you put in your head as far as I know does the same thing that a 301 redirect does in your htaccess. Matt talks about it in the video in my link above. So from the sounds of it you should 301 redirect in your htaccess

As I said in my first post, I can’t add anything to the head. And I don’t want to 301 as I’m reluctant to kill the domain off completely.

Oh I see what your saying. The PDF is the same content so don’t split the seo. Yes I’ve read about that. I don’t know how to deal with it though.

Flexing my google skills…

#2 down seems to answer this http://www.seomoz.org/blog/htaccess-file-snippets-for-seos

Yeah, what I’m trying to is…

pseudo code:

<Witchcraft “example.com/original”>
Head set Link <http://www.new.com/wants-original-kudos&gt;; rel=“canonical”
</Witchcraft>

See above

I know that code, it’s the same as in a link I posted above, I just wonder if it’s any different I would need to do for an html file rather than a pdf.

I see no reason why PDF would be different

Most of the pages are .html but I also have a few “index.php?searchStr=&_a=view” pages

On WAMP I’ve created an htaccess with nothing in it except for:

<Files test.txt>
Header add Link ‘<http://www.example.html>; rel=“canonical”’
</Files>

but visitiing http://localhost gives me a “500 Internal Server Error”

If I delete it from htaccess, localhost is fine.

Yeah htaccess does not work out of the box in wamp. Will give that error

Must do this for wamp http://www.sitepoint.com/forums/showthread.php?t=997125