Canonical Url and .com/ versus .com/index.php

Discussion in 'Search Engine Optimization' started by thudufushi, Dec 18, 2006.

  1. #1
    Guys,

    I often use 301 redirects to cure or prevent canonical url problems of the form domain.com versus www.domain.com.

    However, I just wanted to know about canonical issues regarding

    www.domain.com and
    www.domain.com/index.php or index.html

    If both www.domain.com and www.domain.com/index.php are in Googles index, is this a problem to the same extent as the www. versus no www. canoncial problem. If so how is it fixed.

    I normally use this in .htaccess for the www. redirect.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

    Cheers
    Steve
     
    thudufushi, Dec 18, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just redirect site.com/index.php to site.com and you will be fine. Its not normally an issue but its best to make certain by using a redirect.

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
    RewriteRule ^index\.php$ http://www.site.com/ [R=301,L]
    Code (markup):
     
    mad4, Dec 18, 2006 IP
    thudufushi likes this.
  3. thudufushi

    thudufushi Well-Known Member

    Messages:
    1,145
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Youre a star, thanks
    Steve
     
    thudufushi, Dec 18, 2006 IP