Add 404 Page for all nonexistent Subdomains


Hello! I have been trying to add a 404 Page for all non-existent Subdomains on - similar to how 000webhost does it with

Any help? I’ve been looking for this for hours online :expressionless:


Please explain further.
Do you mean you have a domain, and you wamt all unexisting subdomains redirect to that?


Hi you can achieve it by creating a custom file let’s take for example 404.html , it is your 404 error page when visitors will visit any non existent url on your domain and then create a file called .htccess and add this piece of code into it
ErrorDocument 404 /404.html


Yes, i would like all on existing subdomains to redirect to that :grinning:


But that only seems to work for pages on my site that dont exist. I would like a custom 404 page for all subdomains that dont exist - similar to


That would work if you had a VPS, you would redirect everything the VPS does not know to that page.

Shared hosting does not allow that on the other hand, if you do so, all subdomains would redirect to the 000webhost 404 page


Another alternative would be to use cloudflare’s page rules.



I got it to work with Cloudflare, but it just shows the 000webhost error page rather than my own. How do I change that?


You can’t :slight_smile:
A VPS is the only way to do so, as you can tell the server to redirect to your own 404 if the subdomain does not exist


ok :grinning: thanks for your help.

Could you please explain what a VPS is?



Thanks :+1::grinning:


So did we solve your problem?


yes, i think ill just leave it with the 000webhost error page for now with cloudflare, but im looking into vps now :+1:


Thanks for all of the quick responses, it helped a lot :grinning:


Anytime :slight_smile: