htacess redirect 301

Discussion in 'Site & Server Administration' started by martyn11post, Aug 6, 2009.

  1. #1
    Hi,
    I'm trying to redirect an old website to the new domain, the files are in the same place on the server. The old domain (not actual!) was something.example.co.uk/
    The new one is "www.something.org"for example.

    I believe I need a 301 redirect but i'm not sure how to write the code.

    Any help please!!

    many thanks,
    Martyn
     
    martyn11post, Aug 6, 2009 IP
  2. Janak

    Janak Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can set up redirection code via .htaccess file. Simply use below code in your .htaccess file:

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^something.example.co.uk [nc]
    rewriterule ^(.*)$ http://www.newdomain.com/$1 [r=301,nc]
     
    Janak, Aug 10, 2009 IP
  3. badeyes

    badeyes Active Member

    Messages:
    411
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Login to your domain account panel and forward the old domain to the new domain.. simple as 1.. 2... 3....

    or use .htaccess option as Janka said if you have hosted your old domain somewhere.
     
    badeyes, Aug 12, 2009 IP
  4. sachiezta

    sachiezta Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    301 can still hurt your site .. what is the problem on moving in to a new domain?
     
    sachiezta, Aug 12, 2009 IP
  5. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What about the people still trying to visit the old site?
     
    SecureCP, Aug 12, 2009 IP