If we try to access a non-existant Multisite site, e.g., http://site1.example.com or http://example.com/site1/, we are redirected to http://example.com/wp-signup.php?new=site1.
How to block this and instead of it show 404 error?
If we try to access a non-existant Multisite site, e.g., http://site1.example.com or http://example.com/site1/, we are redirected to http://example.com/wp-signup.php?new=site1.
How to block this and instead of it show 404 error?
The option is in Network Admin, Settings, Network Settings, Allow new registrations
(screenshot from WordPress's Managing a Multisite Network video)
You want either "Registration is disabled" or "User accounts may be registered".