301 redirect

Discussion in 'Search Engine Optimization' started by vipplaymates, Oct 11, 2009.

  1. #1
    Can anyone tell me how to do a 3o1 redirect


    I have no experience at all .

    Also do u have to have a redirect on . My site is listing with the www. and without the www.


    help please
     
    vipplaymates, Oct 11, 2009 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Go to your FTP editor and make sure you have "show hidden file types" turned on.

    Then either download and insert this, or create a new file called .htaccess and put this in there:

    
    RewriteEngine on
    
    # Redirects non-www version to www. version
    RewriteCond %{HTTP_HOST} ^yourdomain\.tld [NC] 
    RewriteRule .? http://www.yourdomain.tld{REQUEST_URI} [R=301,L]
    
    # Redirects /index.ext to /
    RewriteRule ^(.+/)index\.ext?$ http://www.yourdomain.tld/$1 [R=301,L]
    
    Code (markup):
    Make sure you replace yourdomain with your actual domain (such as digitalpoint), tld with the top level domain (such as com net org info) and ext with the extension of the home page (html, php for example).

    Then upload the .htaccess file to your server. NOTE: You WILL NEED to be hosted on an Apache server with mod_rewrite enabled to do this.
     
    Dan Schulz, Oct 11, 2009 IP
  3. scissors

    scissors Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks to vipplaymates for asking the question and to Dan for the reply.

    This is something I've been meaning to do for months but never got round to. If I knew it was this simple I'd have done it ages ago!
     
    scissors, Oct 11, 2009 IP
  4. webdev007

    webdev007 Active Member

    Messages:
    1,037
    Likes Received:
    13
    Best Answers:
    3
    Trophy Points:
    88
    #4
    webdev007, Oct 11, 2009 IP