redirecting 2 domain-types in different roots

Using a single web hosting account to host multiple sites

redirecting 2 domain-types in different roots

Postby flotzge83 » Wed Aug 26, 2009 2:45 am

hi folks,

i've a question about a htaccess prob... ;)

situation:

i have some domains like:
1. xyz.com, xyx.com, alotmore.com
2. xyz24.com, xyx24.com, alotmore24.com

i would like to seperate this domains in different document roots!

solutions should be:
1. xyz.com, xyx.com, alotmore.com
-> /httpdocs/site_normal/
2. xyz24.com, xyx24.com, alotmore24.com
-> /httpdocs/site_24/

but extern the user should only see the domain without internal redicretions..

is this possible with mod_rewrite?

thx 4 your help ;)

greets
flotzge83
 
Posts: 1
Joined: Wed Aug 26, 2009 2:31 am

Postby richardk » Sat Aug 29, 2009 1:51 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} .(24)\. [OR]
RewriteCond normal (normal)
RewriteCond %{DOCUMENT_ROOT}/site_%1%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{HTTP_HOST} .(24)\. [OR]
RewriteCond normal (normal)
RewriteRule ^(.*)$ /site_%1/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests

cron