#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0

    Site check - canonical url - page rank


    Hi

    This is my first post and bad luck an error occured just after submitting. I hope it will not be a duplicate.

    I am confused about cononical urls. Let me explain taking my site as an example.

    1/ I redirect all paulgodard-com to www-paulgodard-com
    RewriteCond %{HTTP_HOST} ^paulgodard-com$ [NC]
    RewriteRule ^(.*)$ www-paulgodard-com/$1 [R=301]

    2/ The root index.php file redirects to another page into a first level folder /Alpha/Page.php
    header("location:www-paulgodard-com/Alpha/Page.php");

    3/ My site is dynamic and I rewrite all url via .htaccess
    RewriteRule ^Content_(.+)_(.+).htm$ /Alpha/Page.php?Content_ID=$1&kw=$2 [NC]
    RewriteRule ^News_(.+)_(.+)_(.+).htm$ /Alpha/Page.php?Content_ID=$1&News_ID=$2&kw=$3 [NC]

    4/ All this works fine but I end up with 3 urls with the same content and apparently with different PR
    www-paulgodard-com : PR=3 (it was 4 a while ago)
    www-paulgodard-com/Alpha/Page.php : no PR
    www-paulgodard-com/Content_1000000000_home.htm : PR=3 (this is the link used to go back to the home page by clicking on the logo)

    What am I doing wrong and how practically can I solve the problem of these 'canonical urls' as well as not drp PR values?
  2. #2
  3. Smoke me a kipper...
    SEO Chat Hero (2000 - 2499 posts)

    Join Date
    Aug 2007
    Posts
    2,472
    Rep Power
    78
    Make sure that in point 2 you're using a 301 permanent redirect:
    header('HTTP/1.1 301 Moved Permanently');
    header("Location:www-paulgodard-com/Alpha/Page.php");

    Why is the logo not going straight to the home page instead of Content_1000000000_home.htm?

    -- Edit --
    Having another thought, why not use mod_rewrite to rewrite your root url to /Alpha/Page.php, eg
    Code:
    RewriteRule ^$  Alpha/Page.php  [L]
    That way www-paulgodard-com/ will still be the homepage - no need for php 301s, and your link from your logo can point to that as would normally be the case.
    Last edited by JagNet; Sep 20th, 2007 at 08:00 AM.
  4. #3
  5. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0
    Thank you JagNet, this is a good start.

    1/ Your suggestion of adding a rewrite rule seems good but will it not conflict with the other ones? Is it at the right place? Also what will happen with such an url www-paulgodard-com?ref=test ?

    #Removes session id from URL - site will not work if cookies are not enabled
    php_flag session.use_trans_sid off

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^paulgodard-com$ [NC]
    RewriteRule ^(.*)$ www-paulgodard-com/$1 [R=301]

    RewriteRule ^$ Alpha/Page.php [L]

    RewriteRule ^Content_(.+)_(.+).htm$ /Alpha/Page.php?Content_ID=$1&kw=$2 [NC]
    RewriteRule ^News_(.+)_(.+)_(.+).htm$ /Alpha/Page.php?Content_ID=$1&News_ID=$2&kw=$3 [NC]

    ErrorDocument 401 /AccessControl/AdminMessage.php?Error=401
    ErrorDocument 404 /AccessControl/AdminMessage.php?Error=404
    ErrorDocument 500 /AccessControl/AdminMessage.php?Error=500


    2/ About the link from the logo, should it now be www-paulgodard-com?
  6. #4
  7. Smoke me a kipper...
    SEO Chat Hero (2000 - 2499 posts)

    Join Date
    Aug 2007
    Posts
    2,472
    Rep Power
    78
    It shouldn't conflict, no.

    You may need to try using "RewriteRule ^/$" if "RewriteRule ^$" doesn't work. Or put "RewriteBase /" before any rewrite rules. I haven't tested it so you may need to play around a little, but the theory is sound.

    Point the logo to www-paulgodard-com/ with the trailing slash - by default your domain without the trailing slash redirects to the version with, so pointing all internal links to the trailing slash version avoids an unnecessary redirect for the user.
  8. #5
  9. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0
    Once again, thank you very much. This was very straight forward. I think I got it right as the only url is www-paulgodard-com for the 3 situations. Would you mind checking and let me know if everything is fine?

    Now, is there a way to tell Google to drop its indexes for the 2 urls not in used anymore (www-paulgodard-com/Alpha/Page.php & www-paulgodard-com/Content_ID...) to avoid the pages to be penalized or do I have to put a permanent redirect? How do I do that?

    I also wonder if the type of url 'domain/News_1190000000_1_orange+and+green+namib.htm' is acceptable as I have seen posts saying that '_' and '+' are not always well seen by se... is that true? Should I change this or it is not worth the effort?
  10. #6
  11. Smoke me a kipper...
    SEO Chat Hero (2000 - 2499 posts)

    Join Date
    Aug 2007
    Posts
    2,472
    Rep Power
    78
    That looks like it's done the trick!

    Best option is to 301 redirect the old URLs. In your .htaccess, try:
    Code:
    Redirect 301 /Alpha/Page.php http://www.paulgodard.com/
    Redirect 301 /Content_1000000000_home.htm http://www.paulgodard.com/
    As for the use of + in the url, if you can use a hyphen instead it looks better, especially for URLs that are meant to look static, but I've never had any problems from the occasions where I have had to use a + (ok, maybe I didn't have to -- just too lazy to recode )
  12. #7
  13. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Sep 2007
    Posts
    4
    Rep Power
    0
    The second 'Redirect 301 /Content_1000000000_home.htm www-paulgodard-com works fine for this page

    But as soon as I add 'Redirect 301 /Alpha/Page.php www-paulgodard-com/ it does not work anymore : The page isn't redirecting properly... Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    I don't really understand why, but so far I have removed it.
  14. #8
  15. Smoke me a kipper...
    SEO Chat Hero (2000 - 2499 posts)

    Join Date
    Aug 2007
    Posts
    2,472
    Rep Power
    78
    Just another afterthought! You may want to consider using .htaccess to clean up the URLs even more. Not that there would be any SEO benefit as such, but they would look a lot neater for people browsing your site.

    Example:
    htaccess:
    Code:
    RewriteRule ^artist.htm$ Alpha/Page.php?Content_ID=1010000000&kw=artist [L,NC]
    would give you the URL: /artist.htm

    Then 301 the old URL to the new as before with the old homepage URLs.

    Ok, it's a little more work and as mentioned it's not going to have any SEO benefit worth speaking of, and it could disrupt your SERPs temporarily whilst the 301s are established by Google, but personally I do like a nice tidy URL
  16. #9
  17. Smoke me a kipper...
    SEO Chat Hero (2000 - 2499 posts)

    Join Date
    Aug 2007
    Posts
    2,472
    Rep Power
    78
    Originally Posted by paulgodard
    The second 'Redirect 301 /Content_1000000000_home.htm www-paulgodard-com works fine for this page

    But as soon as I add 'Redirect 301 /Alpha/Page.php www-paulgodard-com/ it does not work anymore : The page isn't redirecting properly... Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    I don't really understand why, but so far I have removed it.
    hmm, could be conflicting because /Alpha/Page.php IS the root page now.

    You could (in your htaccess) try something like:
    Code:
    RewriteCond %{THE_REQUEST} ^[A-Z]{3, 14}\ /.*Alpha/Page\.php\ HTTP/
    RewriteRule ^(.*)Alpha/Page\.php$ /$1 [R=301,L]
    or, in php in the page.php file:
    Code:
    <?php 
    if (!isset($_GET['Content_ID'])) {
        header('HTTP/1.1 301 Moved Permanently');
        header('Location: http://www.paulgodard.com/');
    }
    ?>

Similar Threads

  1. Optimize your Optimizations - Bad examples
    By PRNewsNow in forum Search Engine Optimization
    Replies: 3
    Last Post: Mar 1st, 2006, 07:27 PM

IMN logo majestic logo threadwatch logo seochat tools logo