8 domains to one

Using a single web hosting account to host multiple sites

8 domains to one

Postby KPaul » Mon Dec 17, 2007 4:11 pm

Hello everybody,
I have extremely iritating problem with my domain. All of them
(4 international, 4 German) should redirect to one folder (one domain).
I want to do this redirection with url address bar hiding.
This mean when I go from one domain this should redirect me to another domain whith the url hiding of the second.

All the domains and and main site are stored on the same physical mashine.

Simply example:
domainA
domainB

User put in a address bar domainA then the redirection process begin to domainB but the in the address bar user have all the time name of domainB.

How to write the htaccess to fix this problem.

Any suggestions will be very appreciated.
KPaul
 
Posts: 7
Joined: Sun Nov 04, 2007 1:22 pm

Postby richardk » Mon Dec 17, 2007 4:44 pm

What are the current document roots like? Do you have access to the httpd.conf file?

Mod_rewrite can't change a domain's document root from a .htaccess file (unless it's to a sub directory of the current document root) but you can proxy requests if you have mod_proxy.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby KPaul » Mon Dec 17, 2007 4:57 pm

The domains tree looks like:
domainA.com
domain_A.com
A_domain.com

Adomain.com

domainA.de
domain_A.de
A_domain.de
Adomain.de

I haven't access to https.conf
Now the main site is in Adomain.com any other should be redirect to this with url hiding.

Till now I have prepared something like this:

.htaccess in Adomain.com:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} !^$

RewriteCond %{HTTP_HOST} ^domainA.com\$1 [NC]
RewriteRule ^(.*)$ http://www.domainA.com/ [QSA,L]

RewriteCond %{HTTP_HOST} ^domain_A.com\$1 [NC]
RewriteRule ^(.*)$ http://www.domain_A.com [QSA,L]

How this will see if there will be mod_proxy enabled?
KPaul
 
Posts: 7
Joined: Sun Nov 04, 2007 1:22 pm

Postby richardk » Tue Dec 18, 2007 11:00 am

I need to see the document roots (the path to the files, eg. /home/you/public_html/domainA).

I doubt mod_rewrite can do this. You would be better asking your host about it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby KPaul » Tue Dec 18, 2007 1:59 pm

Exacly like in the last example the root path is:

/userxxx/www/domainA
/userxxx/www/domain_A
/userxxx/www/Adomain
/userxxx/www/A_domain
etc...

By host provider have no idea how to do this. They said the only possible way is to use the FRAMES which I wouldn't use.

Is there any other way to do this?
If so maybe a little example.
KPaul
 
Posts: 7
Joined: Sun Nov 04, 2007 1:22 pm

Postby richardk » Tue Dec 18, 2007 2:22 pm

In order of best to worst:

Your host should be able to change the server configuration to send all domains to the same document root. It could be done with one <VirtualHost> in the httpd.conf file
Code: Select all
<VirtualHost *:80>
  ServerName  example.com
  ServerAlias www.example.com

  ServerAlias exampleA.com www.exampleA.com
  ServerAlias exampleB.com www.exampleB.com
  ServerAlias exampleC.com www.exampleC.com
  # etc.

  DocumentRoot /the/single/document/root
</VirtualHost>


Or, if you can create Symbolic Links (or your host can), you can create symbolic links for all the document roots to the one main document root.

Or, if it is available, you can use mod_proxy and mod_rewrite in a .htaccess file in each document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(.*)$ http://www.example.com/$1 [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 1 guest

cron