I have following structure in my root directory
/
/-site1
/-site2
.
.
.-site-n
I want to have site1.example.com to use site1 folder, site2.example.com to use site2 folder and so on. I want to achieve this with htaccess.I also want to redirect to 404 page if a directory (sitex) not exist. Please provide me suggestion to write htaccess file and also mention where should I need to put it.