1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change Primary Domain

Discussion in 'XenForo Questions and Support' started by Dynamic, May 4, 2012.

  1. Dynamic

    Dynamic Well-Known Member

    Hi guys,

    Currently I have www.domain.com that is redirecting to www.domain.com/forum/ via .htaccess

    I want to change the primary domain of the site, but I do not want to lose my google ranking. Will it be possible to make www.domain2.com become my primary domain, whilst www.domain.com redirects to www.domain2.com?

    I have WHM/cPanel installed, and am on a dedicated server. Please tell me what I need to to, as I would like this to be up as soon as I can.

    Thanks.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    If the two domains are on different hosting accounts then you can setup a .htaccess file in the web root of the old domain. Use this code to redirect all requests to the new domain:

    Code:
    Redirect 301 / http://www.domain2.com/
    
    The 301 redirect will also instruct Google to update its links.

    If the two domains are parked on the same account then you can use a rewrite rule:

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^www\.domain2\.com$
    RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
    
    And of course you should update your board URL:

    Admin CP -> Home -> Options -> Basic Board Information -> Board URL
     
    Dynamic likes this.
  3. Dynamic

    Dynamic Well-Known Member

    Love you dude. Thanks!
     
  4. Dynamic

    Dynamic Well-Known Member

  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Possibly your board URL setting:

    Admin CP -> Home -> Options -> Basic Board Information -> Board URL

    Or a misconfigured .htaccess file.

    I can take a look if you give me FTP and admin access.
     
  6. Dynamic

    Dynamic Well-Known Member

    Hi Jake,

    I'll PM you my .htaccess file if you like? my board url is correct, so I think you are right with the misconfigured file.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Sure. Send it to me and I will look it over.
     
  8. Dynamic

    Dynamic Well-Known Member

    Thanks man.
     

Share This Page