Is there any way to redirect nonexistent subdomains to my 404 page?

Explained in the question.
soundarahari.eu.org

Perhaps add a CNAME record like this:
*.soundarahari.eu.org to soundarahari.eu.org/my-404-page

DNS Validation Error (Code: 1004) Content for CNAME record is invalid i get this error at cloudflare

Use cloudflare page rules to redirect [anything].domain.tld to the 404 page, cname’s are used for mapping of IP addresses;
https://support.cloudflare.com/hc/en-us/articles/200172286-Configuring-URL-forwarding-or-redirects-with-Cloudflare-Page-Rules

1 Like

is this correct?

I believe so.

:+1:

still it doesn’t work

@anon77371365 if you use CloudFlare to manage your DNS then create a CNAME record as mentioned below:

Type   Name  Content
CNAME   *     404 URL 

The above one works for me and redirects all non-existent subdomain to my home page.

1 Like

Why do you need this btw?
Do you create a network or something (such as WP Multisite network)?

That will create many hits for your hosting account.
& if your site force to use SSL connection, you have to create Wildcard SSL, too.

Hmmm

Oh, It’s because, Cloudflare comes second, And because the wildcard isn’t a subdomain on your account, It send it to the bodis holding page, Sadly, the only thing to do would be remove the * cname record for 1176.bodis.com.

I removed it before itself

Yeah, I think it is because the Control Panel recognises it as a subdomain, Which isn’t added,but it pointed, hence looking like a suspended site. I’m not sure how much you can do at this point, apart from put redirects on each subdomain individually.

I have a wild card ssl

I am a novice, Please elaborate it :pray:

Ok, Basically, the Cpanel domain system works as below;

  1. Domain is pointed to any IP Address relating to a server
  2. It checks to see if the domain is in a file;
  3. If it is, then it gets the location e.g /home/vol13_5/blahblabla
  4. If it is not in a file, it shows the default page, which is the suspension page

What has happened, is because the wildcard subdomains aren’t in the file, it shows the default page. [Basically]

So I have got an idea,

Add an another domain of mine to addon domain
And upload my 404.html as index.html
and add a cname record as *.soundarahari.eu.org to my404.tld in my main domain

Will this work?

Yes, It should.

Okay, I don’t know what I did exactly but somehow all nonexistent subdomains go to my 404page in that same domain.Can anyone verify that is it only for me or for everyone.

soundarahari.eu.org
try going to any non existent subdomain.
do not try mail.soundarahari.eu.org