1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to create 301 Redirect code

Discussion in 'SEO' started by rajesh.solse, Jan 11, 2012.

  1. #1
    When I checked my site's backlinks with typing www and non-www in address box, both URL's are showing different backlinks. I searched on google to use 301 redirect method to get rid of this problem. but I am not getting this file and procedure to create 301 redirect. So please help me to create this file.
     
    rajesh.solse, Jan 11, 2012 IP
  2. Samykrish

    Samykrish Greenhorn

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    This issue is regarding the canonical...... if your site is on platform of PHP then put the 301 redirect code in .htaccess file:

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?>
     
    Samykrish, Jan 23, 2012 IP
  3. msllearning

    msllearning Greenhorn

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    using this code use redirect your site with www.

    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^url$
    RewriteRule ^(.*)$ "http\:\/\/www\.urll\.com\/$1" [R=301,L]
     
    Last edited: Jan 23, 2012
    msllearning, Jan 23, 2012 IP
  4. aces7

    aces7 Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A bit off topic, I hope you don't mind: does doing a 301 redirect pass on PR to another website? I want to buy a PR5 site and redirect the authority to my new ecommerce website, the high PR site will not be relevant to my new site, is this a problem?
     
    aces7, Jan 24, 2012 IP
  5. shmister

    shmister Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    The PR will pass, it has nothing to do with relevancy. Just do it and wait a few days.
     
    shmister, Jan 24, 2012 IP
  6. bluechiphome

    bluechiphome Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Download the .htaccess file from your website’s root web folder to a folder on your machine where you can edit it.
    Make a copy of the .htaccess file and save it somewhere else for safe keeping in case you need to revert to the old version – do not edit this version.
    Open the original .htaccess you downloaded in Notepad
    Add the following code (in red) into the .htaccess file. Be sure to substitute “example.com” with your own website information but touch nothing else.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    Upload the file back to your website in the exact same place you downloaded it.
    Once the upload is complete open a browser and try visiting the “non-www” version of your website address. If the .htaccess is working as it should you will be redirected.
     
    bluechiphome, Jan 25, 2012 IP
  7. mamtak

    mamtak Member

    Messages:
    229
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #7
    you should search in Google. they have lots of code for 301.
     
    mamtak, Jan 26, 2012 IP
  8. jamesfletcher

    jamesfletcher Greenhorn

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    If you don't know how to do 301 redirect don't worry. Refer this URL http://support.google.com/webmasters/bin/answer.py?hl=en&answer=44231, you just need to Preferred domain. once you prefer you domain, its not necessary to do 301 redirection.
     
    jamesfletcher, Jan 27, 2012 IP
  9. priyaverma2012

    priyaverma2012 Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    for 301 redirect you can find lots of code in google.
     
    priyaverma2012, Jan 27, 2012 IP
    jknandlal likes this.
  10. bluechiphome

    bluechiphome Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yes. This is best code for redirect ur................
     
    bluechiphome, Feb 29, 2012 IP
  11. sethnickerson

    sethnickerson Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #11
    That's the stuff, right there!

     
    sethnickerson, Mar 1, 2012 IP
  12. stiveseo

    stiveseo Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #12
    You have canonical problem, to avoid it you should redirect the url through ht access file.....
     
    stiveseo, Mar 2, 2012 IP