Forum Moderators: phranque
When a subdomain is created it can be accessed as:
www.foobar.mysite.com/
--OR--
www.mysite.com/foobar/
Question 1:
Is there a way to prevent a user from accessing the subdmain by the sub-directory, i.e., mysite.com/foobar? I'm thinking that that there must be a way using .htaccess--can someone point me to a web site that will help? Maybe an example of the code?
Question 2:
Elsewhere in this forum there are references to subdomains as a way to balance the server load. Is this true and what does it mean to someone who rents space on a server?
Question 3:
Aside from load balance are there any pros or cons to using subdomains? What about search engine spiders?
To prevent users from accessing the subdir, you could :
RewriteRule /foobar/(.*) [foobar.mysite.com...] [R]
This is of the top of my head, so might be that I forget something.
Cheers,
Jazeker
Thanks for the suggestion. I haven't got it working it--so if anything else comes to mind...
I'm wondering if the reason it is not working is that I vaguely recall that there was a command that needed to be at the top of the .htaccess file that had something to do with Directory. It's been awhile and can't find it in my notes.
"Load balancing" only applies if you point your various subdomains to various servers.
Search engine spiders index pages, not sites. So there should be no practical difference.
Subdomains can be useful as "branding" tools, or to divide a huge site into more manageable pieces, like sales.example.com, support.example.com, production.example.com, etc.
Jim