SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    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/...-to-folder.php. If you want a 301 redirect its under htaccess in my site

  3. #3
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Eric

    Cross site canonicalisation is observed by Google.


  4. #4
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I need a version of the HTTP code from this blog post "How To: Advanced rel="canonical" HTTP Headers"


  5. #5
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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...?

  6. #6
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    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

  7. #7
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brocberry View Post
    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...?
    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.

  9. #9
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Flexing my google skills...

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

  10. #10
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, what I'm trying to is...

    pseudo code:

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

  11. #11
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Brocberry View Post
    Yeah, what I'm trying to is...

    pseudo code:

    <Witchcraft "example.com/original">
    Head set Link <http://www.new.com/wants-original-kudos>; rel="canonical"
    </Witchcraft>
    See above

  12. #12
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  13. #13
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I see no reason why PDF would be different

  14. #14
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most of the pages are .html but I also have a few "index.php?searchStr=&_a=view" pages

  15. #15
    SitePoint Enthusiast Brocberry's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  16. #16
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Yeah htaccess does not work out of the box in wamp. Will give that error

  17. #17
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •