Make two sub-domains show the same content (alias?)

Kwanbis

Registered
Jul 18, 2019
2
0
1
Internet
cPanel Access Level
Website Owner
I am an old-school software developer with enough knowledge to setup a domain, a subdomain, etc., but what I want to do is above my understanding.

So today, I have two installations of wordpress, one at example.com, and a second one at blog.example.com. As you probably imagine, in example.com we have the main website, and in blog.example.com a company blog.

It is important to notice that by default, whenever I type example.com, it gets redirected somehow to www.example.com.

But we updated the template and the new version allows us to have a blog within the main website (example.com or www.example.com).

That is great, but we do not want to loose our old blog.example.com links, for SEO and other reasons.

In the end, what we want to achieve is that whatever content is accessible through

http://www.example.com/2019/05/some-blog.html

is at the same time available through:

http://blog.example.com/2019/05/some-blog.html

I thought that by creating a CNAME from blog. to example.com will work, but is not. Any ideas? Thank you very much!

Just to make it clearer, I don't want blog.example.com to redirect to www.example.com, I want to point to the same content. Thanks.
 
Last edited by a moderator:

kdean

Well-Known Member
Oct 19, 2012
407
82
78
Orlando, FL
cPanel Access Level
Root Administrator
But 301 redirecting would be the correct way to handle it. The SEO rank will transfer to the new links and eventually the old links will drop off the search engines. Any old bookmarks and links on other sites will still function, but everything on search engines will be represented by the new location links, which should be the ultimate goal anyway.

Wordpress sites that aren't in Multisite mode only run under one domain so wordpress itself will bring them to the new site anyway.

Best to just setup the wildcard redirect on the old site as long as all the redirected paths match.
 
  • Like
Reactions: cPanelMichael

Kwanbis

Registered
Jul 18, 2019
2
0
1
Internet
cPanel Access Level
Website Owner
But 301 redirecting would be the correct way to handle it. The SEO rank will transfer to the new links and eventually the old links will drop off the search engines. Any old bookmarks and links on other sites will still function, but everything on search engines will be represented by the new location links, which should be the ultimate goal anyway.

Wordpress sites that aren't in Multisite mode only run under one domain so wordpress itself will bring them to the new site anyway.

Best to just setup the wildcard redirect on the old site as long as all the redirected paths match.
So how do I do that? Any ideas? Thanks!
 

kdean

Well-Known Member
Oct 19, 2012
407
82
78
Orlando, FL
cPanel Access Level
Root Administrator
Assuming your blog. domain is added as a subdomain on your account and that your DNS is pointing to the server…

When you log into cPanel, in the Domains section you should find Redirects.

There you select "Permanent (301)", then you select your blog. domain and in "Redirects to" enter the full url of the new domain including http(s). Then select "Wild Card Redirect" and click Add and you should be good to go. Links to blog. domain with a additional path should redirect to the same path on the new domain.
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello @Kwanbis,

Let us know if you have any additional questions.

Thanks!