vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Page 1 of 3
1 2 3 LastLast
Results 1 to 15 of 42

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
    Real Name
    Joseph Ward
    Join Date
    Jun 2005
    Posts
    23,847
    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 09:34 AM.

  2. #2
    FIM
    FIM is offline
    Member
    Real Name
    ROGER
    Join Date
    Aug 2006
    Posts
    70
    Thanks man
    :thumbsup:

  3. #3
    Junior Member
    Real Name
    Baitona
    Join Date
    Dec 2008
    Location
    London
    Posts
    29
    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 Ace Shattock's Avatar
    Real Name
    Ace Shattock
    Join Date
    Jul 2005
    Location
    New Zealand
    Posts
    3,709
    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.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Final)- Released for your Evaluation


    My Personal Sites: New Zealand Forum | vBulletin Modifications and Styles | vBulletin Hosting

  5. #5
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    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
    Real Name
    bhanu
    Join Date
    Jan 2007
    Posts
    35
    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 04:00 PM.

  7. #7
    Member
    Join Date
    Jan 2006
    Posts
    31
    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
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,539
    Blog Entries
    2
    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
    Real Name
    David
    Join Date
    Nov 2007
    Posts
    25
    I have a 500 Internal Server Error from this redirect, how to solve it?

  10. #10
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,539
    Blog Entries
    2
    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
    Real Name
    David
    Join Date
    Nov 2007
    Posts
    25
    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
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,539
    Blog Entries
    2
    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 Brandon Sheley's Avatar
    Real Name
    Brandon Sheley
    Join Date
    Oct 2005
    Location
    Kansas
    Posts
    2,208
    Blog Entries
    1
    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 08:48 PM.
    Are you on Twitter? @BrandonSheley | Social Media blog
    Latest projects: General Forums | TopekaTweetup

  14. #14
    Senior Member
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,539
    Blog Entries
    2
    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 Brandon Sheley's Avatar
    Real Name
    Brandon Sheley
    Join Date
    Oct 2005
    Location
    Kansas
    Posts
    2,208
    Blog Entries
    1
    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
    Are you on Twitter? @BrandonSheley | Social Media blog
    Latest projects: General Forums | TopekaTweetup

Similar Threads

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