www to no-www redirect help needed urgently

Discussion in 'Site & Server Administration' started by jhnrang, Mar 16, 2007.

  1. #1
    Hi
    Most probably I am the dumbest Webmaster on DP (if I can be called so--with not even basic knowledge:eek: )

    I need --to do a redirect of my 3 sites---from www to no-www and vice versa.

    http://pagerankluck.com to http://www.pagerankluck.com

    http://dbestdir.com to http://www.dbestdir.com

    http://www.amazingindiaexperience.info to http://amazingindiaexperience.info

    I am afraid that with backlinks behaving abnormally during last few days--my PR may get divided.--So I need it done today itself.

    I have no idea about anything. So please give me detailed instruction where to edit--which file/folder/code and where to put the codes.

    Please help--I need it done by today.
    If possible--or some-one is ready to do it for me --I can even pay --a small token fee--as I emptied my Paypal buying links:eek:
     
    jhnrang, Mar 16, 2007 IP
  2. boron

    boron Well-Known Member

    Messages:
    1,072
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    140
    #2
    There are two solutions for this - as I know.

    First method: you can do a permanent 301 redirect via .htaccess file. Search engine bots will check this file then first and will crawl redirected site only and all events (page indexing, backlinks checking, applying PR...) will take place only there.

    How to do a 301 redirect?
    Go into your site's cpanel/file manager and look in the root directory if you can find an .htaccess file. If yes then edit it as described below, if not you'll have first to create it:
    Open Notepad and copy-paste this code in if you want make
    from No-www to www redirect:

    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    Rewritecond %{http_host} ^domain.com [nc]
    Rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] 
    </IfModule>
    
    Code (markup):
    or this for www to No-www redirect:

    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    Rewritecond %{http_host} ^www.domain.com [nc]
    Rewriterule ^(.*)$ http://domain.com/$1 [r=301,nc]
    </IfModule>
    
    Code (markup):
    **(Change domain.com and www. domain.com with your domain.)

    Name the file as [/B].htaccess (exactly so - with the dot in front). If browser won't allow you to create this kind of file, then do it this way: a.htaccess . If still not alowed (because of extension) then do it like: htaccess.txt . Then go into your site's cpanel/file manager and upload this file on a root directory (the very first directory in your file manager which should look like this "/" -slash only). When uploaded, rename it to .htaccess if necessary.
    ....................................................................................................

    Second way: You can tell Google which domain you prefer: www or no-www. Go to Google webmaster tools and login (or create an account first). You'll see "Add sites" option, so add your site(s).

    After that you'll need to verify them. Click on "verify" and chose "add html file" option. Copy the bolded file name "xyxyxyx....html" you'll find there and go to Notepad and create the file with this name (no content needed), then go in control panel/file manager and upload it into the "public_html" directory. Then go back in Google and click on the link yoursite.xyxyx...html. The file should apper in the browser search line. If it did, then click on "verify" and you should get "site...verified succesfully" message.

    OK, now check the box in the front of the desired site and click on "Manage: site." Click on "Diagnostic" then "Prefered domain". Then simply write in the domain you want Google will crawl (www one or no-www one). That's it.
     
    boron, Mar 17, 2007 IP
    jhnrang likes this.
  3. jhnrang

    jhnrang Notable Member

    Messages:
    4,107
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    225
    #3
    Thanks mate for such a detailed instruction--i am trying now-.:eek:
     
    jhnrang, Mar 17, 2007 IP
  4. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Isn't it www\.domain\.com ??

    I guess escape characters are needed in .htaccess
     
    agnivo007, Mar 17, 2007 IP
  5. boron

    boron Well-Known Member

    Messages:
    1,072
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    140
    #5
    It is www.domain.com, isn't it?

    Can this be explained?
     
    boron, Mar 18, 2007 IP