addondomains to subdirectorys

Using a single web hosting account to host multiple sites

addondomains to subdirectorys

Postby jianquan » Sat Nov 25, 2006 6:08 am

I have an Hosting account: A.com. A.com is a main domain.

And I have three addondomains with A.com: B.com,C.com,D.com.

What I want is to redirect B.com to a folder inside A.com, let's say A.com/B, C.com redirect to A.com/C, and D.com redirect to A.com/D.

This redirection should be masked, so A.com is never showned in the status bar or address bar.

What can I do in htaccess file? Help.

thanks a lot.
jianquan
 
Posts: 1
Joined: Sat Nov 25, 2006 4:42 am

Postby richardk » Sat Nov 25, 2006 9:55 am

In a .htaccess file in A.com's document root:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?A\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.com$ [NC]
RewriteRule ^(.*)$ /%2/$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: No registered users and 36 guests

cron