Forum Moderators: phranque

Message Too Old, No Replies

Pointing Multiple Domain Names to Different Folders on your Server

Can anyone give me any advise as to pointing multiple domain names to diffe

         

TeamSDA

2:19 am on Jul 30, 2011 (gmt 0)

10+ Year Member



Hello All,

We're trying to work out a way to have 4 domain names point to one server but go to different folders inside the server. Our hosting provide allows for us to edit out .htaccess file. Here is what I currently have found from researching Google. Does anyone have any experience with this technique or a better way? Will these harm my SEO strength in any way?


RewriteEngine On
RewriteBase /

# pointing for the domain abc.com to folder abc
ReWriteCond %{HTTP_HOST} abc.com
ReWriteCond %{REQUEST_URI} !abc/
ReWriteRule ^(.*)$ abc/$1 [L]

# pointing for the domain 123.com to folder 123
ReWriteCond %{HTTP_HOST} 123.com
ReWriteCond %{REQUEST_URI} !123/
ReWriteRule ^(.*)$ 123/$1 [L]




Thank you for your input,

Christian

wilderness

4:08 am on Jul 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



domain2 2011 [google.com]

lucy24

4:25 am on Jul 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does "us" mean that there are four separate humans attached to the four separate domains, but you're all piggybacking on one account? Before you do anything with your htaccess, read your hosting plan's fine print and maybe have a talk with your host. It may not be necessary for you to do anything at all except click a few buttons.

wilderness

4:47 am on Jul 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



"read your hosting plan's"

Many hosts (even el cheapo's) offer multiple domain hosting these days. I've even seen a few advertise "unlimited domains".

lucy24

6:38 am on Jul 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, that's what I meant. I've got three domains and three humans sharing my account, configured like this:

two of us have access to domain A (in theory, at least: the real owner is afraid to touch it and I'm happy to keep it that way ;))

one of us has access to domain B plus one subdirectory of domain C

one of me has access to the rest of domain C (actually all of domains B and C, but that's only because my son never bothered to change his password :)) And all of domain C, including the part aliased to human B's userspace, is included in the logs that live in human C's userspace.

But the only htaccess involvement was that I had to make a duplicate for the one directory that's in my son's userspace. (Just the allow-and-deny parts, no rewrites or redirects.) That's why I suggested looking at the fine print before you start tearing out your hair.

wilderness

2:50 pm on Jul 30, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



lucy,
Many of these "el cheapo" hosts are not standard in their configurations. Some are even shoddy.
I used an "el cheapo" for two years that didn't offer ftp access for raw logs, which I found a great inconvenience.

Getting answers from these "el cheapo's" regarding "raw logs" before committing to a package is almost impossible.

TeamSDA

2:22 am on Aug 1, 2011 (gmt 0)

10+ Year Member



Hi lucy24 and wilderness,

Thank you for your input. I talked with my hosting company and was told to handle the multiple domains through my .htaccess file.

Our company has many websites that we are trying to find a way to consolidate on one server. So since we have to go down the .htaccess file, do you have any input on this code below:


RewriteEngine On
RewriteBase /

# pointing for the domain abc.com to folder abc
ReWriteCond %{HTTP_HOST} abc.com
ReWriteCond %{REQUEST_URI} !abc/
ReWriteRule ^(.*)$ abc/$1 [L]

# pointing for the domain 123.com to folder 123
ReWriteCond %{HTTP_HOST} 123.com
ReWriteCond %{REQUEST_URI} !123/
ReWriteRule ^(.*)$ 123/$1 [L]





Regards,

Christian

buckworks

4:06 am on Aug 1, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Have you checked what kind of domain redirection services might be offered by your registrar?

Some registrars make it very easy to redirect a domain name to an URL of your choice, avoiding the need to mess about on your server.

lucy24

6:06 am on Aug 1, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, that was my first thought, but this host is apparently taking the approach of "It's your account, you deal with it!" Which may be an advantage in the long term if it means you've got more direct control over what you're doing.

Do you have the server to yourselves? Can you get at the config file? You want to start at the highest level you've got access to.

TeamSDA

5:17 pm on Aug 1, 2011 (gmt 0)

10+ Year Member



@Buckworks,

That was my first thought, but my registrar will not allow me to point a domain to a folder inside my server. They only have provision for pointing to a IP address.


@lucy24

We're on a share server and don't have access to our config file.



Christian