Results 1 to 3 of 3

Thread: Domain and directory structuring problem

  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Question Domain and directory structuring problem

    Hi,

    I'm having a bit of trouble managing my directory structure in contrast to my domain- and subdomain structure.

    I have one primary domain from BH and 13 other (addon/parked) domains reserved from another registrar. This makes for 14 domains linked in my cPanel, twelve of which need to show the same content as my primary domain and two which I need to have them share their own document root. In addition I need subdomains for both addons so that I can access both, say, staging and production versions through these subdomains. They would also live in their own unique (but shared) document root as well. Put another way, what I want is this:

    Code:
    (www.)domain-X.com -> /public_html/PRODUCTION/domain-XY
    (www.)domain-Y.com -> /public_html/PRODUCTION/domain-XY
    staging.domain-X.com -> /public_html/STAGING/domain-XY
    staging.domain-Y.com -> /public_html/STAGING/domain-XY
    Problem is - if I leave these domains parked, I can create subdomains for the uses I want, but if I browse for eg www.domain-X.com, I end up with the content being drawn from my primary domain (call it primary.com for example) which is not at all what I want.

    If, in parking, I create a .htaccess file with the following terms:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?domain-x\.com$
    RewriteRule ^(/)?$ PRODUCTION/domain-xy/index.php [L]
    RewriteCond %{HTTP_HOST} ^(www\.)?domain-y\.com$
    RewriteRule ^(/)?$ PRODUCTION/domain-xy/index.php [L]
    I get the BH template response of "There is no website configured at this address."

    If I assign them as addon domains, I can't create the document root in the place I want, as I am forced to give the "/public_html/website" type of path, no subfolders. This, again, is not something I want.
    This was I can create the subdomain I want through the cPanel subdomain manager, but when assigning the addon domain, I am required to give the addon domain as the subdomain to my primary domain (ie. domain-x.primary.com) which yet again is not what I want.

    I can't get any htaccess code working so I could bypass and override the "/public_html/website" path into "/public_html/PRODUCTION/domain-xy", as if I enter the following code:

    Code:
    RewriteCond %{HTTP_HOST} ^(www\.)?domain-x\.com$
    RewriteCond %{REQUEST_URI} !^/PRODUCTION/domain-xy
    RewriteRule ^(.*)$ PRODUCTION/domain-xy/$1 [L]
    I just get a 500 internal server error... I've tried plowing through the threads here but haven't found a solution

  2. #2
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,951

    Default

    Parking a domain points it at public_html

    If you want a domain to use a different folder then set it up as an add-on domain and specify the folder it is to point to during the setup.

    The only domain you need to redirect to a folder using .htaccess is the main one.

  3. #3
    Join Date
    Mar 2010
    Posts
    2

    Default

    Quote Originally Posted by felgall View Post
    If you want a domain to use a different folder then set it up as an add-on domain and specify the folder it is to point to during the setup.
    Perhaps you didn't read my post entirely - this is what my problem is about. I can't specify the folder path I want, but in stead am forced to give a "/public_html/folder" path in stead of a subfolder eg. "/public_html/here_goes/folder" type of path.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •