PDA

View Full Version : Sub-domains



caddickj
02-15-2005, 10:36 PM
This is probably really simple, but my brain is just not working that well tonight.

How do I get a sub-domain to refer to an existing sub-folder in my site?

For example, let's say I had a folder www.domain.com/pictures. When I go to photos.domain.com, I want it to read from the /pictures folder (but still say photos.domain.com in the address).

Does that make sense? Is it possible?

Just to be clear, I know creating a sub-domain creates a like named folder (I'd have a folder called /photos in the above example), but I want to do this with an existing folder. In fact, in my real-life example, I want the sub-domain to show the contents of a folder 2 levels down from root.

Jeff
02-16-2005, 09:51 AM
Simplest solution would be to put an .htaccess redirect that refers to the destination into the subdomain directory. There is another thread here in the forum that describes the process for creating redirects - you can find it by using the search feature.

eugene
02-16-2005, 11:38 AM
Be careful about putting in your own hardcoded .htaccess directives as several apps (like DA) might overwrite them.

caddickj
02-16-2005, 12:29 PM
Cool.... thanks guys. I knew there was a way.

D9r
02-19-2005, 02:34 PM
Originally posted by eugene@Feb 16 2005, 10:38 AM
Be careful about putting in your own hardcoded .htaccess directives as several apps (like DA) might overwrite them.

Quoted post

What do you mean? When would DA overwrite .htaccess files?

tnas
02-22-2005, 09:49 AM
If you edit your .htaccess file, and then decide to add something like password protect from DA, DA will overwrite any "special stuff" you had in your .htaccess file with plain vanilla password protection. I have seen it happen on a sub-domain that I have protected access on based on IP address. I need to keep a safe copy of the special .htaccess file just incase I accidently wipe it out.