How to make a subdomain folder load as primary public html folder

smeko

Active Member
Feb 17, 2020
29
2
3
Tirane, Albania
cPanel Access Level
Root Administrator
Hello,

I administrate a cpanel shared hosting server and one of my client wanted a test enviroment to built a new wordpress site. I create a subdomain under public html and now the new site is ready to be published. I tried to move all files and folders from subdomain folder to main public html folder but it shows me this error when i try to reach my primary domain:

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Please can anyone help me to instruct how to publish new site, so to load folder of subdomain when i search for primary domain ?

Silvi
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
The files for the subdomain site just would need to be moved to the document root of the main domain. You'd also need to change the URL in Wordpress to reflect the location.
 

smeko

Active Member
Feb 17, 2020
29
2
3
Tirane, Albania
cPanel Access Level
Root Administrator
The files for the subdomain site just would need to be moved to the document root of the main domain. You'd also need to change the URL in Wordpress to reflect the location.
Hi,

I resolved the problem this way:
1-I uploaded wp content folder from subdomain folder to public html of primary domain.
2- I updated wp-config with those records
define('WP_HOME','http://mysite.com');
define('WP_SITEURL','Website Hosting - Mysite.com'
Also i changed name and password of database at wp config.
3- I installed velvet blues plugin and changed urls to wordpress as this:
Select Tools > Update URLs from the WordPress sidebar. Enter your old (subdomain) and new (root domain) URLs and in Step 2, check all options except Update All GUIDs.
Now everything is working fine.
Problem resolved ✅
 
  • Like
Reactions: cPanelLauren