Make non-existent sub-domains redirect to main domain
We have multisite set up with sub-domains (mapped to normal domains) and we do use some sub-domains (like test or dev) that aren’t part of the multisite, but I want other sub-domains (say if someone mistypes) to just redirect to our main domain.
I have * in the DNS so it goes to our server properly, and I have *.ourdomain.com in our vhost file which handles any random sub-domain, but then it pushes it to the WordPress install which tries to treat it like an official sub-domain and gives an “Error connecting to database”. I just want it to redirect to ourdomain.com and I’m not sure the best way to do this.
- The topic ‘Make non-existent sub-domains redirect to main domain’ is closed to new replies.