Redirection for non existing subdomain


Just wondering if possible to set a redirection rule for non existing subdomain.
(I’m using the free cloudflare service)

Example: (subdomain does not exist) — this should be redirected to → instead

as for the apache configuration, its no longer possible to set the redirection. as we already have set the wildcard * vhost to point to the installed system. the system is the one who is handling the subdomains for each client. changing the code would be difficult for now, as we need to request customization to the system.

any work around on cloudflare dns config for this scenario.


Just create a dummy DNS record that points to a dummy destination (e.g.

And then use the page rule to do the redirect.

HI Eric,

thanks for the fast feedback.

my scenario is users most of the time go to random subdomains. what we want to accomplish is that even if users randomly go to non existing subdomains they should be redirected to a default site.

Without an Enterprise plan, this is actually difficult to configure. Non-Enterprise users can have a wildcard DNS record, but it can’t be proxied - thus can’t configure the page rules to do the redirect.

Hi Eric,

instead of redirection. do you have an error page from cloudflare (can be customized)
do you have that feature on the free cloudflare service?

currently the error from browser if you visit non existing subdomains are:

  • cant find the server (safari)
  • the server cannot be reached (chrome)

As Eric said, unless that DNS record is :orange: proxied, there’s nothing Cloudflare can do for non-existing subdomains.

Hi Sdayman,

thanks for the reply.

i see since its proxied we cannot really do anything about it.
just in-case, if we move to enterprise/business/pro plan. so we need just need to disable the proxy? what happens to ssl and cdn after we disable, is this same for free plan that automatically it will just be a dns only setup?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.