Forum Moderators: phranque

Message Too Old, No Replies

Subdomain Questions

what are the advantages and disadvantages?

         

Storyman

6:10 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



I'm in the process of building a site that will have many subdomain. The hosting company used allows as many subdomains as needed.

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?

Jazeker

6:21 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



> www.foobar.mysite.com/
> --OR--
> www.mysite.com/foobar/

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

Storyman

7:57 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



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.

Storyman

9:17 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



Located the command:

DirectoryIndex index

However it works (I think) only with mod_rewrite.

jdMorgan

1:00 am on Nov 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To prevent direct access to the subdomain-related subdirectories, use the technique descibed in this thread: [webmasterworld.com...]

"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