Removing alias breaks the website

BluePlanet

Member
Apr 29, 2018
15
3
3
Egypt
cPanel Access Level
Root Administrator
Hi all,

I created a cPanel with the customer domain name website.com
I built the website on a temporary URL, like customer.mydomain.com, which is assigned as an alias, with no redirection-
Whilst the site sits on the temporary URL, the customer can customize it and keep the previous website live.
When the customer is ready, he will redirect his domain name to my server IP. Once DNS have propagated and the site is live, I go and remove the alias.

At this point, the live website breaks. I've had this 2 times and can't figure out why.
From the browser's console, it would appear it is not loading any of the .js files.
Any help, please.
 
Last edited:

BluePlanet

Member
Apr 29, 2018
15
3
3
Egypt
cPanel Access Level
Root Administrator
Thank you, it was added just an alias, not as subdomain.
It was also not redirected anywhere. It was just an additional domain, where the website was available till it would go live.

I solved with a redirection on the .htaccess file
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello @BluePlanet,

Does the website use an application such as WordPress? If so, browse to the administration area of the application installed on the website and ensure it's properly configured to reflect the correct domain name.

To test if this is the culprit, upload a simple HTML file in the document root of the website and confirm if it loads.

Thank you.
 
  • Like
Reactions: BluePlanet

BluePlanet

Member
Apr 29, 2018
15
3
3
Egypt
cPanel Access Level
Root Administrator
Many thanks @cPanelMichael
the website uses a proprietary code, developed in PHP. The entire CMS folder and its subfolder required to be redirect through .htaccess
What I find interesting is that the situation occurs only when I remove the (non-redirected) alias.
If I create a new cPanel account using the alias as domain and then replace it with the customer domain, when he is ready to go live, then everything is fine.

Also, if I delete all the content of /public_html and upload the standard content again, it all works fine, even without any redirection on .htaccess
 
Last edited:

BluePlanet

Member
Apr 29, 2018
15
3
3
Egypt
cPanel Access Level
Root Administrator
Absolutely @cPanelMichael glad to see this level of support and engagement!

On the website where the issue occurred, we already fixed the situation, with an .htaccess redirect.

Would you like me to build a dummy site, apply an alias and then remove it? So you can see from the console what errors are returned when the alias is removed. Please let me know, tnx.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Would you like me to build a dummy site, apply an alias and then remove it? So you can see from the console what errors are returned when the alias is removed. Please let me know, tnx.
Hello @BluePlanet,

Can you do this, and let us know the full step-by-step instructions you use to reproduce the issue?

Thank you.