Page 1 of 4 1 2 3 4 LastLast
Results 1 to 15 of 59

Changing Domains: Directing Old Site to the New Site with htaccess

This is a discussion on Changing Domains: Directing Old Site to the New Site with htaccess within the General Discussion forums, part of the vBSEO SEO Plugin category; For SEO purposes, in most cases it is advisable to maintain your current domain name . However, if you decide ...

  1. #1
    Senior Member Array
    Real Name
    Joseph Ward
    Join Date
    Jun 2005
    Posts
    23,845
    Liked
    44 times
    Blog Entries
    9

    Post Changing Domains: Directing Old Site to the New Site with htaccess

    For SEO purposes, in most cases it is advisable to maintain your current domain name.

    However, if you decide to change it, you need to 301 redirect the traffic from the old domain to the new.

    To do so, you just need to add (or edit) a htaccess file to the root of the old site. The contents of the .htaccess should be the following:

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.domain.com/$1 [L,R=301]
    Replace www.domain.com with the domain of your new site.

    Any page request on the old site, will automatically get sent to the same page on the new domain.

    This helps save you from losing traffic during a domain change, and also helps the search engines discover the new location of the content.
    Last edited by Mert Gökçeimam; 10-08-2008 at 08:34 AM.

  2. #2
    FIM
    FIM is offline
    Member Array
    Real Name
    Fim
    Join Date
    Aug 2006
    Posts
    74
    Liked
    1 times
    Thanks man
    :thumbsup:

  3. #3
    Junior Member Array
    Real Name
    Baitona
    Join Date
    Dec 2008
    Location
    London
    Posts
    29
    Liked
    0 times
    Hi Joe

    thanks for this code above however i have a small question:

    what can be the extra line in .htaccss to redirect
    http://h-zaman.baitona.net/vb/t720.html

    to
    http://www.baitona.net/vb/t720.html

    btw the above lines are examples

  4. #4
    vBSEO Staff Array Ace Shattock's Avatar
    Real Name
    Ace Shattock
    Join Date
    Jul 2005
    Location
    Auckland, New Zealand, New Zealand
    Posts
    4,033
    Liked
    31 times
    Hi Baitona,

    You can achieve that by using the rule that comes in the vBSEO .htaccess, just replace domain.com with your domain.
    Ace Shattock / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


    My Personal Sites: New Zealand Forum | vBulletin Modifications and Styles | New Zealand Food | New Zealand Android OS Talk | vBulletin Hosting

  5. #5
    Senior Member Array webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times
    Can the same thing be achieved by just parking the old domain, setting up right nameservers for it, and having this code in new domain/site's htaccess

    [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects

    It would redirect all parked domains to the new domain taking care of all pages too, is that correct?

    thanks

  6. #6
    Member Array
    Real Name
    bhanu
    Join Date
    Jan 2007
    Posts
    51
    Liked
    0 times
    i am changing my domain name google webmaster tools says we should take care of internal links too will this take care of everything ?

    edit:-

    ok i placed this now all links point to new domain but strange when i come to site from google search results i still see old domain :(, i have parked old domain , is that way correct ?
    Last edited by bhanuprasad1981; 08-07-2009 at 03:00 PM.

  7. #7
    Member Array
    Join Date
    Jan 2006
    Posts
    31
    Liked
    0 times
    my old domain and my new domain use the same ftp because my old domain is still a subdomain of my new domain
    how can i modify the code so the redirect will work?
    can you help me? thank you

  8. #8
    Senior Member Array
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    3 times
    Blog Entries
    1
    Quote Originally Posted by Diver View Post
    my old domain and my new domain use the same ftp because my old domain is still a subdomain of my new domain
    how can i modify the code so the redirect will work?
    can you help me? thank you
    In your old domain root folder add these lines in htaccess file

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.domain.com/$1 [L,R=301]
    Change the URL to your new domain

  9. #9
    Junior Member Array
    Real Name
    David
    Join Date
    Nov 2007
    Posts
    25
    Liked
    0 times
    I have a 500 Internal Server Error from this redirect, how to solve it?

  10. #10
    Senior Member Array
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    3 times
    Blog Entries
    1
    What's happen if you add the codes in this thread ?
    [How to] Check if mod_rewrite is working for my site
    Does the test page redirect you to Google ?

  11. #11
    Junior Member Array
    Real Name
    David
    Join Date
    Nov 2007
    Posts
    25
    Liked
    0 times
    Weird, it still throw 500 Internal Server error...
    and this is the error in my cpanel log: .htaccess: Illegal option FollowSymLinksRewriteEngine

    My server has the mod_rewrite running well before this and when I move domain names and put in the setting as recommended at the top, it shows error. Any ideas about how to solve this?

  12. #12
    Senior Member Array
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    3 times
    Blog Entries
    1
    That's looks like your .htaccess have a problem make sure there is space between "FollowSymLinks" and "RewriteEngine On"
    Thus, the two different variables are recognized as one "FollowSymLinksRewriteEngine On".
    I recommended you to edit your htaccess file via Cpanel file edit because It's a common issue with some text editors not to interpreter the blank space and new line characters

  13. #13
    Senior Member Array Brandon Sheley's Avatar
    Real Name
    Brandon Sheley
    Join Date
    Oct 2005
    Location
    Kansas
    Posts
    2,364
    Liked
    26 times
    Blog Entries
    2
    is this the same thing we use in subdomains too?
    I'm trying it out and it doesn't seem to work correct
    this is what I want to do

    http://old.site.com
    to
    http://new.site.com/category/widgets/

    thx

    ps.. this is on a wordpress blog
    Last edited by Brandon Sheley; 09-10-2009 at 07:48 PM.

  14. #14
    Senior Member Array
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    3 times
    Blog Entries
    1
    Quote Originally Posted by Brandon Sheley View Post
    is this the same thing we use in subdomains too?
    I'm trying it out and it doesn't seem to work correct
    this is what I want to do

    http://old.site.com
    to
    http://new.site.com/category/widgets/

    thx

    ps.. this is on a wordpress blog
    Yes Brandon it should work

  15. #15
    Senior Member Array Brandon Sheley's Avatar
    Real Name
    Brandon Sheley
    Join Date
    Oct 2005
    Location
    Kansas
    Posts
    2,364
    Liked
    26 times
    Blog Entries
    2
    Quote Originally Posted by marco1 View Post
    Yes Brandon it should work
    Hello,
    It didn't work for me.

    if you went to
    old.site.com/about/
    it would go to
    new.site.com/category/widgets/about/

    I just want all visitors going to
    old.site.com/{any page}
    to be sent to
    new.site.com/category/widget/

    can this be done with an htaccess redirect or a php redirect inside a blank index.php page?

    thanks

Page 1 of 4 1 2 3 4 LastLast

Similar Threads

  1. Multiple domains pointing to site.com
    By Zagis in forum General Discussion
    Replies: 24
    Last Post: 02-27-2009, 01:08 AM
  2. Changing URL for site..
    By Martyn in forum General Discussion
    Replies: 3
    Last Post: 09-18-2007, 07:37 AM
  3. 2 domains - 1 site
    By nlpconnections in forum General Discussion
    Replies: 2
    Last Post: 08-08-2007, 12:25 PM
  4. Replies: 0
    Last Post: 07-18-2007, 06:03 PM
  5. CHanging site URL
    By wellrooted in forum General Discussion
    Replies: 1
    Last Post: 04-23-2007, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •