best way for redirecting

Discussion in 'Search Engine Optimization' started by sprabhu, Sep 17, 2008.

  1. #1
    hi I want to redirect my website from non www to with www.

    Just want to confirm, should i change in .htaccess file and please tell me the code also ?
     
    sprabhu, Sep 17, 2008 IP
  2. gtwlabs

    gtwlabs Peon

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes,

    you can put code in .htaccess file.

    Here is the Details of Redirection Code :

    If you need to redirect http://mysite.com to
    http://www.mysite.com
    and you've got mod_rewrite enabled on
    your server you can put this in your .htaccess file :

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]

    or this:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

    Tip: Use your full URL (ie http://www.domain.com) when
    obtaining incoming links to your site. Also use your full
    URL for the internal linking of your site.

    ----------------------------------------------

    Thanks
    Eric
     
    gtwlabs, Sep 17, 2008 IP
  3. sprabhu

    sprabhu Peon

    Messages:
    586
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks, one more think
    Should i put this code in each of my website individually to work. ?
     
    sprabhu, Sep 17, 2008 IP
  4. jg_abad

    jg_abad Peon

    Messages:
    903
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #4
    see you can do it in two way
    1) by changing .htaccess as describe by gtwlabs and
    2) by google webmaster tool, in which u have to submit your website in google webmaster tool. where you will find this option.

    let me know if u need any help
     
    jg_abad, Sep 17, 2008 IP
  5. sprabhu

    sprabhu Peon

    Messages:
    586
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks,
    but the second option will works only for google, not other search engines. Is the same option available in yahoo and msn :cool:
     
    sprabhu, Sep 17, 2008 IP