Sub-domain Advice - Stop access to sub-folder directly

I want to create a sub-domain for one of my sites. I can do this but the site can be viewed by going directly to the sub-folder, eg.: http://thesite.adomain.com can also be viewed by going to http://adomain.com/thesite

Would this cause an issue with Google, etc? How can I redirect those going to http://adomain.com/thesite to the correct address of http://thesite.adomain.com ?

Thanks for any help :)
In your public_html's .htaccess, put the following:

Code:
RewriteRule ^(thesite/.*)$ http://thesite.adomain.com/$1 [R=301,L,NC]
 
When you create a subdomain in cPanel it auto-populates with public_html and the start. You could also trim that so it's alongside the public_html folder instead of within it. That's the way I've always preferred.
 
Top