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

Change Primary Domain

Dynamic

Well-known member
#1
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.
 

Jake Bunce

XenForo moderator
Staff member
#2
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
 

Jake Bunce

XenForo moderator
Staff member
#5
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.
 

Dynamic

Well-known member
#6
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.