Redirection for non existing subdomain

Hi,

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

Example:

123.abc.com (subdomain does not exist) — this should be redirected to → www.abc.com instead

as for the apache configuration, its no longer possible to set the redirection. as we already have set the wildcard *.abc.com 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.

thanks

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

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.