Need help about changing domain name (on the same host/server)

EMAOneBillion

Senior Member
Joined
May 31, 2019
Messages
864
Reaction score
414
I was dumb enough to get a misspelled domain (it's just missing an "s") and lazy enough to change it on time and now I have a well-established site with plenty of ranking keywords that I need to update the domain name and I'm scared that I will lose the rankings.

Most guides I found on the internet imply using the new domain on a new host but I want to keep the original host and point the new domain to it.

Besides, I'm using Cloudflare and I don't know how to set it up for the new domain without losing all the settings and customizations I made.

From my understanding:

#1

I have to change the nameservers of the new domain to point out to the Cloudflare nameservers I'm using on the old domain, right?

Now the first question: should I remove the Cloudflare nameservers from the old domain so it doesn't interfere with the new domain?

#2

Now once the new domain is pointing to Cloudflare, the next thing is to change the website URL in the database and WordPress dashboard, right?

Correct me if I'm missing something, please.

#3

Now the site should be live on the new domain address. In addition to the above, do I have to change any DNS records in Cloudflare? I don't think so as all the records are pointing to the host but correct me if I'm wrong.

#4

Finally, considering I haven't skipped any step everything should be OK now except the redirects.

Regarding them, what's the best practice to do the 301 redirects, considering I want to do a wildcard redirect aka redirecting all URLs from the old domain to the same path to the new domain.

Should I do it in Cloudflare, or should I do in GoDaddy with the Forwarding option? What happens if I set the redirects in both Cloudflare and GoDaddy just to make sure it doesn’t skip any URL?
 
No problem to use the same host and everything
Just set that domain and do a 1:1 redirect 301 from the old domaint o the new one
You will lose traffic for a while but it may settle over the time
Here you have all the examples you need to set such redirection

But If my old domain won't be any longer linked to any host I don't think I can do server-side redirects.
That's why I'm asking how to properly do it.
I see that I can do it with Cloudflare and via GoDaddy with the Forwarding option. Is it legit?
 
But If my old domain won't be any longer linked to any host I don't think I can do server-side redirects.
You need to keep it for as long as you want to stablish your redirect. Generally when I do this kind of things, I keep it for an extra year.
Problem with forwarding is that is not a 1:1 which is what you need
For example:

yourolddomain.com/my-first-page ===> yournewdomain.com/my-first-page
 
But if I have my new domain live on the original server (on which the old domain was linked to) how can I keep the old domain live too so I can do the redirects?
Sorry but I'm really stupid with this stuff.
 
Does your hosting server have any support for this?

No, no support at all.

So if I do the following will everything be OK?

1. So I have the OldDomain live on my OriginalHost.
2. I create a new account in cPanel for the NewDomain to create a new separate directory for the NewDomain on the same host.
3. I enter the directory folder for the NewDomain and copy all the Wordpress files from the OldDomain.
4. Copy the database from the OldDomain to NewDomain too.
5. Now I'm updating the URL in wp-config to reflect the URL of the NewDomain.
6. Change the nameservers of NewDomain to point to OriginalHost.
7. Now both NewDomain and OldDomain should be live on the same host, with the exact same content, but no redirects, right?
8. The only thing now is to build a 301-header for the OldDomain to redirect 1:1 to NewDomain.

Have I missed something?

Really appreciate all the help.
 
Have I missed something?
1. You put both domains pointing to different folders in the same server. Old domain to a blank folder, New domain to the folder with all the content.
2. Then you create a .htaccess in your old domain root folder (the one empty). In that .htaccess file is where you are going to create all the redirections (which is only one by the way)

Then you do the 1:1 redirect. If you look in Google you will find the Rewrite rule pretty straight forward. If I'm not wrong it may look something like this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]
 
1. You put both domains pointing to different folders in the same server. Old domain to a blank folder, New domain to the folder with all the content.
2. Then you create a .htaccess in your old domain root folder (the one empty). In that .htaccess file is where you are going to create all the redirections (which is only one by the way)

Then you do the 1:1 redirect. If you look in Google you will find the Rewrite rule pretty straight forward. If I'm not wrong it may look something like this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]

You rock! Thanks so much for your support, it all makes sense now.
 
Back
Top