BASE Tag

Discussion in 'Search Engine Optimization' started by ottodo, Sep 17, 2006.

  1. #1
    Hello,
    I have a question about base tag and SEO
    I saw many times this tag but i have no idea what is the relation with SEO
    Does anyine know?

    Cheers!
     
    ottodo, Sep 17, 2006 IP
  2. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Pat Gael, Sep 17, 2006 IP
  3. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ottodo, Sep 17, 2006 IP
  4. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #4
    301 redirect is made adding a few lines to your .htaccess file, this way

    
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^your_domain.com/index.php$ [OR]
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com/index.php$
    RewriteRule ^(.*)$ http://www.yourdomain.com [R=301,L]
    
    Code (markup):
    in this example your are redirecting all the input which include index.php in the URL to www.yourdomain.com with no file name.

    301 redirect can be used in a number of ways and it depends on your needs how to use it and what for.

    Some reading about it: www.tamingthebeast.net/articles3/spiders-301-redirect.htm
     
    Pat Gael, Sep 17, 2006 IP
  5. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #5


    I want to redirect www . mydomain.com to mydomain.com
    I used this code:
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
    RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
    
    Code (markup):
    but it redirect from mydomain.com to www . mydomain.com :confused:
    how can i do the reverse?
     
    ottodo, Sep 17, 2006 IP
  6. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can do any of these redirections this way:


    Redirect www.domain.com to domain.com
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301] 
    
    Code (markup):
    Redirect domain.com to www.domain.com
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] 
    
    Code (markup):
     
    Pat Gael, Sep 17, 2006 IP
  7. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Wow that's amazing?
    btw, which is better for SE the first redirect or second one?
     
    ottodo, Sep 17, 2006 IP
  8. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Deciding which is best in every case depends on different factors:

    Pagerank: most sites have 2 different pagerank values, with and without www. Selecting the one with the higher rank is the most advisable.

    Affinity: some domains "sounds" better with www while other are more suitable without them, particularly those with info and name extension. Ask yourself how your domain name sounds better and go for it.

    Personal Preferences: disregard the reason, some people prefer keep using www as former display option. If you feel comfortable with your domain name either way, choose that way for redirecting.
     
    Pat Gael, Sep 17, 2006 IP
  9. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #9
    that's great
    but what about Duplicated content?
    As you said www . my domain.com id not as mydomain.com
    I am talking about TOS of Adsense?
    Should I do anything for this?
     
    ottodo, Sep 18, 2006 IP
  10. seopool

    seopool Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I am not confident about <base> tag, I feel sometime it is good and sometimes it is bad for website, so be conscious with this tag
     
    seopool, Sep 18, 2006 IP
  11. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #11
    In the past there were speculations about using <base> tag, but actually it helps your site to be compliant with the Disabilities Discrimination Act.

    Exactly, if you want to minimize this risk, go for one or another redirect option.

    This way all your traffic is lead to your chosen version, including Search Engines.
     
    Pat Gael, Sep 18, 2006 IP
  12. RedCardinal

    RedCardinal Peon

    Messages:
    349
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Handy for dynamically generated directoriy structures - tells the browser where to find files with relative URLs such as stylesheets and javascript files.

    Have to be a little careful though as some clients simply dont follow the <BASE> rule. You tend to find quite a few 404 errors from mobile devices and the like.
     
    RedCardinal, Sep 18, 2006 IP
  13. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #13
    which is better using Base tag or using 301 redirect and mod_rewrite?:confused:
     
    ottodo, Sep 18, 2006 IP
  14. RedCardinal

    RedCardinal Peon

    Messages:
    349
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Sorry didn't mean to confuse. After reading entire thread I can see that you want to use the .htaccess 301 redirect as advised above.

    Forget about <base> if all you want to do is redirect www.yoururl.com to yoururl.com.
     
    RedCardinal, Sep 18, 2006 IP