New Posts
Welcome guest, is this your first visit?
  • Login:
Online Forum Challenge
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Canonical URLs

  1. #1
    Formerly TPB
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    Wales
    Posts
    666
    Feedback Score
    16 (100%)

    Default Canonical URLs

    If you put an index.php file in a folder, you can view that page by visiting either:

    www.site.com/folder/
    www.site.com/folder/index.php

    Is this a bad thing? Even if you only link to that page across the site with www.site.com/folder/, can this cause any problems?

    If so, what methods can you use for redirecting one URL like this to another?

  2. #2
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    United States
    Posts
    626
    Feedback Score
    9 (100%)

    Default

    This is a good question. I've always assumed that it was fine, but I know that's not the best way I should of gone about it. Does anyone have any evidence of this mattering?
    PokerTrikz - The Free Poker Training Site.

  3. #3
    CK
    CK is offline
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    ?
    Posts
    2,226
    Blog Entries
    2
    Feedback Score
    35 (100%)

    Default

    Code:
    RewriteCond %{THE_REQUEST} ^.*/index.php
    RewriteRule ^(.*)index.php$ /$1 [R=301,L]
    That should do it.

    The reason for this is so you tell google what instance of the page should be used since there are techinically two versions of the page which are accessible. Although most don't bother, it is good idea so you don't have to worry about the index.php from ever getting indexed. It's no different than your homepage. You dont want to have more than one version of your homepage indexed, likewise you don't want to have more than one version of any page on your site indexed.
    ----------------------------------------
    Everyone says they are willing to do whatever it takes to get ahead - but yet there are so few people up at 5AM ? - Robert Herjavec
    ---------------------------------------

  4. #4
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Jan 2009
    Location
    Northern Europe
    Posts
    882
    Blog Entries
    6
    Feedback Score
    3 (100%)

    Default

    Edit: What Kaus said

    I have read numerous accounts of people having had problems because you could access the same page at more than one URL. Most of it seems to have been caused by people linking to different addresses for the same page - but it is some time ago, so it may not happen any more. However, I think it is best to make sure that your pages can only be accessed at 1 URL and have the other ones redirect to that.

    This should be fairly easy to do with .htaccess, however, I'm not good friends with that thing, so I hope that someone else chips in with the code.
    My blog www.unknownwebmaster.com | New posts on Poker affiliate blogs | Webmaster tools I use every day.

  5. #5
    CK
    CK is offline
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    ?
    Posts
    2,226
    Blog Entries
    2
    Feedback Score
    35 (100%)

    Default

    Most of it seems to have been caused by people linking to different addresses for the same page - but it is some time ago, so it may not happen any more.
    I don't think thats true. I think if the files are still accessible in different formats then you run the risk of google choosing which way it indexs the page.
    ----------------------------------------
    Everyone says they are willing to do whatever it takes to get ahead - but yet there are so few people up at 5AM ? - Robert Herjavec
    ---------------------------------------

  6. #6
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    United States
    Posts
    626
    Feedback Score
    9 (100%)

    Default

    TY Kaus
    PokerTrikz - The Free Poker Training Site.

  7. #7
    Formerly TPB
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    Wales
    Posts
    666
    Feedback Score
    16 (100%)

    Default

    Thanks Cheryle, that's perfect!

  8. #8
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    Never Mind The Bollocks
    Posts
    207
    Feedback Score
    0

    Default

    This has botherred me for sometime - but if I use your code Kaus and have a multi-level site it defaults back to the top level.

    So if you got xxx.com/index.php and xxx.com/abc/index.php, how do you get that to default to both main domains over multi-levels?




    ....and really, shouldn't Google be clever enough now to know that xxx.com/index.php is the same as xxx.com/ ?

  9. #9
    Bingolady
    My Status
     

    Add as a friend
    Join Date
    Jan 2009
    Location
    In a galaxy far, far away
    Posts
    87
    Feedback Score
    0

    Default

    Quote Originally Posted by Ozpoker View Post
    ....and really, shouldn't Google be clever enough now to know that xxx.com/index.php is the same as xxx.com/ ?
    Not really, as you could have there index.html, index.php etc. and each could have different content it is just your server's setting that which version is the default, so it is better to tell explicitly to google with a 301 redirect that index.php equals the site root and Google has to take it as the "/", so you can avoid duplicate content and link juice and PR pass correctly to the "/" and it is not divided to 2 instances of the same page.
    USA bingo
    UK bingo sites
    "Its great to see that Hugh Heffner isn't the only one building and running his empire in his PJ's!" -SeoPants@AGD

  10. #10
    CK
    CK is offline
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    ?
    Posts
    2,226
    Blog Entries
    2
    Feedback Score
    35 (100%)

    Default

    Quote Originally Posted by Ozpoker View Post
    This has botherred me for sometime - but if I use your code Kaus and have a multi-level site it defaults back to the top level.

    So if you got xxx.com/index.php and xxx.com/abc/index.php, how do you get that to default to both main domains over multi-levels?
    Thats a totally different rule than your other one. This is the rule to rewrite your page to www or non www and will also play into how you want the last bit indexed..either / or /index.php

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    Theone that I posted works to redirect the index.php to the parent file only. Try it..youll see what I mean and for information on what the symbols do if you want to understand it better there is a good description here

    Redirect incomming links with .htaccess to prevent duplicate content penalties - enarion.net


    Code:
    RewriteCond %{THE_REQUEST} ^.*/index.php
    RewriteRule ^(.*)index.php$ /$1 [R=301,L]
    ....and really, shouldn't Google be clever enough now to know that xxx.com/index.php is the same as xxx.com/ ?
    As far as google knowing its the same ...well its not the same. Those are two totally different urls which access the same information.
    ----------------------------------------
    Everyone says they are willing to do whatever it takes to get ahead - but yet there are so few people up at 5AM ? - Robert Herjavec
    ---------------------------------------


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Urls For sale
    By Holis in forum Websites
    Replies: 0
    Last Post: 05-26-2009, 08:04 AM
  2. All-in-one-seo - Canonical URLs
    By Hazo in forum Poker SEO Forum
    Replies: 8
    Last Post: 05-04-2009, 10:24 PM
  3. WTB Aged MMA URLS
    By Holis in forum Websites
    Replies: 0
    Last Post: 04-20-2009, 11:08 AM
  4. Why new urls?
    By Newjabber in forum General Poker Affiliate Forum
    Replies: 4
    Last Post: 03-03-2009, 08:00 AM
  5. SEO URLs plugin
    By MAC in forum Wordpress - Web Design - Coding - Technical
    Replies: 4
    Last Post: 01-21-2009, 10:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.5
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
SEO by vBSEO 3.6.0
Affiliate Program Consultant