Question : Htaccess multiple domain hosted in one account and redirection to subfolder with url masking

Hi everybody,

The problem
-------------------------------------------------------------------------------------
Let say i have 4 domain name called a.com, b.com, c.com and d.com.  I also have an hosting account with godday.com for d domain wich is my business portal.  What i want to do is to host every web site (made with Joomla) under one unique hosting account under wich, each domain will be host in is own subfolder. (See Code A)

What i actually did
-------------------------------------------------------------------------------------
I created sub domain for each domain to host (a,b,c) wich are link to their own subfolder named respectively a,b,c.
I installed joomla in d subfolder and every other subdomain (a,b,c).
Then i used the standard redirect tool from godaddy to redirect the main domain according to the following rules.

     d.com ->www.d.com
     www.d.com ->www.d.com/d

Up to there, everything works fine.  It is still to appearant that everything is host in one place.
I then used the dns manager to redirect with masking every domain to their own respective subdomain at d.com.  I then had to modify configuration.pho for each site to adjust the $live_site variable to the masked url.  So [subdomain].a.com is redirected to a.d.com and the resulting url mask with [subdomain].a.com

For every domain redirected with masking, it's been working fine, but i still had the inesthetique and uncommon url for d.com shown as d.com/d and also the subdomain for each domain not beeing redirected to the proper subfolder into each domain subfolder

I searched to find a solution for masking the real url with htacces and got this bit of code from the net.  (See Code B).  I also had to modify the configuration.php to indicate the good live url (masked one : www.d.com).  Wow, it works, but nothing else work anymore.   It seems to be intercept and modify by the htaccess.

I dont know htaccess, i don't really understand what happen here.  I search the htaccess documentation, but it is so clear that i never found how achieve all my redirection problem.

From there : Do i used the good technique?  Should i remove the masking option from redirected domain to their own respective subdomain under d accound.  Can i do that all with htaccess?  Would it be better and faster to create a php file to achieve this goal.  If yes, how can i do that.

Hoping to find my solution here, my best regards to every member paying attention to this request.

htaccess desesperate guy.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
----------------------------------------------------
Code A (Destination folder tree)
----------------------------------------------------
html
  |-->a                 www.a.com
        |-->sub1     sub1.a.com
  |-->b                 www.b.com
        |-->sub1     sub1.b.com
  |-->c                 www.c.com
        |-->sub1     sub1.c.com
  |-->d                 www.d.com
        |-->sub1     sub1.d.com
 
----------------------------------------------------
Code B (htaccess content)
----------------------------------------------------
 
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
 
RewriteCond %{REQUEST_URI} !(\.|/$) 
RewriteRule (.*) http://www.bdi-management.com/$1/ [R=301,L]
 
RewriteCond %{HTTP_HOST} ^bdi-management.com$ 
RewriteRule ^/?(.*)$ http://www.bdi-management.com/$1 [R=301,L]
 
RewriteCond %{REQUEST_URI} !^/bdi-management
RewriteRule ^(.*)$ bdi-management/$1 [L]

Answer : Htaccess multiple domain hosted in one account and redirection to subfolder with url masking

I'm not really a web programmer, but it seems to me that you are really working hard to do something that should be easy.  IE:
I have a web-hosting package from network solutions that allows exactly what you are trying to do.

I can host up to 40 websites, with 2400+ emails to split up between then as I see fit.  To create a new website I create a subfolder, copy in my code, then select to add a new website.  It asks me for the domain url and which folder it should point to and it gives me an IP address and name-servers to point my domain's DNS to.  I only have to register 1 domain through NS to get this package and, if I pay for the hosting by the year, it comes out to about $12 per month.

I can also host somebody else's site and create their own ftp login and then can only see their folder and modify their site as they desire.  They have no way of knowing that it is a sub-folder of my main account.  It works flawlessly.  I currently have 5 or 6 sites up and I have plenty of expansion available.

This may help or not, but just FYI.
:-)
Random Solutions  
 
programming4us programming4us