CNAME Cloudflare returns a 404 Not Found error.

#1
I use CentOS 7, OpenLiteSpeed, CyberPanel, and Cloudflare.
Here is a list of records on my Cloudflare:

Records.png

I created CNAME "scontent.mydomain.com" which serves as the alias of "mydomain.com" (similar to www). After creating a record, I go to "scontent.mydomain.com" and get an error: 404 Not Found but when I use www and non-www I can still access it normally.
I tried editing the vhost conf file to: vhAliases www.$VH_NAME, scontent.$VH_NAME
Then restart the server but the same error still occurs.
What is the problem here? How can I fix it?
Thanks.
 

Cold-Egg

Administrator
#2
Hi,

Navigate to CyberPanel at port 8090 > WebSites > mydomain.com > Domain Alias
Create Alias with scontent.mydomain.com

And it should works.

Best
 
#3
Hi,

Navigate to CyberPanel at port 8090 > WebSites > mydomain.com > Domain Alias
Create Alias with scontent.mydomain.com

And it should works.

Best
I just did so is it going to work? No need to edit vhost conf file?
I want to get scontent.mydomain.com to act as the CDN of my website, when a user visits scontent.mydomain.com will be redirected to (www.)mydomain.com or will show error message ERR_CONNECTION_REFUSED or ERR_CONNECTION_CLOSED or ERR_FAILED or ERR_EMPTY_RESPONSE or ERR_ADDRESS_UNREACHABLE or DNS_PROBE_FINISHED_NXDOMAIN (in short, the scontent.mydomain.com website cannot be accessed), what should I do?
 

Cold-Egg

Administrator
#4
You can use a rewrite rule to redirect from domain A to domain B.

May I confirm that you don't get any 404 now when visiting scontent.mydomain.com ?
 
#5
You can use a rewrite rule to redirect from domain A to domain B.

May I confirm that you don't get any 404 now when visiting scontent.mydomain.com ?
Yes, that will definitely work. Actually, I just need to create A record named "*", the content is my server IP, I can create as many alias as I like without creating CNAME record on cloudflare anymore. However, I want to ask, is there any way that the other CNAME record when accessed in the normal way will return the error I listed above?
 
Top