Subdomain multisite gives 404 on sub sites

I used a one click install to install wordpress and then converted it into a sub domain multisite. I have made the required changes to the wp-config and htaccess file.
The main site example.com works absolutely fine.
When I try to add another site, it shows that the site has been successfully added. But the address sub1.example.com shows a page that says no content here and sub1.example.com/wp-admin gives a 404 error.(These are both generic pages similar to what my server shows on any random subdomain)