setting up 301's from mysite.com to mysite.com/

Discussion in 'Search Engine Optimization' started by mdvaldosta, Oct 14, 2005.

  1. #1
    would that be wise? I was doing some searching and, even though Im careful to always use the trailing /, many people that visit my site and refer people don't type the /

    Would it help serps to 301 to the the / , or is that something thats done automatically?
     
    mdvaldosta, Oct 14, 2005 IP
  2. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Place this in your .htaccess, it will append the "/" and also the "www" to your URL.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
    RewriteRule ^(.*) http://www.yourdomain.com/$1 [L,R=301]
    </IfModule>
     
    ServerUnion, Oct 14, 2005 IP
  3. briandunning

    briandunning Active Member

    Messages:
    262
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    98
    #3
    What is the benefit of this?
     
    briandunning, Oct 14, 2005 IP
  4. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #4
    this pushes all backlinks to a standardized URL formation.
     
    ServerUnion, Oct 14, 2005 IP
  5. briandunning

    briandunning Active Member

    Messages:
    262
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    98
    #5
    Same question - what's the benefit of THAT? (Not being argumentative, just asking) :)
     
    briandunning, Oct 14, 2005 IP
  6. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #6
    same answer. all backlinks and PR weight will be pushed to standardized URLs even if they link to you site wrong.
     
    ServerUnion, Oct 14, 2005 IP
  7. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #7
    do i need the <IfModule mod_rewrite.c> statements?

    I'm already using the rewrite engine for sef urls
     
    mdvaldosta, Oct 14, 2005 IP
  8. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it will do without, just good programming style to do so
     
    ServerUnion, Oct 14, 2005 IP
  9. frankm

    frankm Active Member

    Messages:
    915
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    83
    #9
    According to the specs, a url like:

    http://www.domain.com is exactly the same as http://www.domain.com/

    and both wil result in the same http fetch request,
    
    GET / HTTP/1.x
    
    Code (markup):
    (even if there was no trailing slash in the url)
     
    frankm, Oct 14, 2005 IP
  10. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #10
    that is true, I prefer to have everything standardized. but that is just me.
     
    ServerUnion, Oct 14, 2005 IP
  11. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #11
    yes they point to the same place, but I see alot of search engine results with 2 listings to the same place, only difference is the trailing / ... and they have different pageranks. Thanks for the code ServerUnion :D
     
    mdvaldosta, Oct 14, 2005 IP
  12. nicknick

    nicknick Peon

    Messages:
    429
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Thanks ServerUnion. That code worked perfectly.
     
    nicknick, Oct 14, 2005 IP
  13. aeiouy

    aeiouy Peon

    Messages:
    2,876
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I use the / code on a php directory site I have because / and no-slash are not considered the same thing due to rewriting.

    So it helps... else you end up with all kinds of wacky urls.
     
    aeiouy, Oct 14, 2005 IP