Results 1 to 8 of 8

Thread: Parked domains, document roots, Apache configuration

  1. #1
    bdominick's Avatar
    bdominick is offline I am a Glowru!
    Join Date
    Dec 2007
    Posts
    76

    Default Parked domains, document roots, Apache configuration

    I have struggled with this problem before and ended up asking GH support to deal with it for me. But it keeps coming up, and I'd like to learn how to catch this fish myself. I need to do it today, and then again in a week or so.

    Here's the deal. The primary domain and parked domains in a client's cPanel site seem to default to the document root /home/[username]/public_html , which is normally fine, but right now I need for different domains to default to different document roots. I don't want to deal with subdomains, so I think Add-ons is out, unless I'm missing something there.

    All I want to do is have newdomain.com use /home/[username]/public_html/subdomain instead. Then, later, I want to change my primary domain to do the same.

    Now, I understand -- I think -- how to do this in the httpd.conf file. But since we're no longer allowed to edit that directly, I am having a lot of trouble making WHM's new Include Editor do anything at all. Whenever I have tried, I have failed, and then Matt or Alexander have come in and done the task for me successfully, but I never learn how they fixed the problem.

    So I'm hoping someone can give advice on how to deal with this stuff. In the meantime, I'll keep trying to figure it out, and maybe I'll answer my own question, since my work is dead in the water till I get this working.

    Thanks in advance...
    Brian Dominick
    | WebRoot Solutions
    | Server Administrator, Software Developer
    http://mywebroot.com

  2. #2
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,208

    Default

    Well, you have two options in cPanel, and one in WHM:

    cPanel:
    Parked Domain: /home/[username]/public_html/ (of main domain)
    Addon Domain: /home/[username]/public_html/subfolder (of main domain)

    Addon also creates a subdomain but its not required that it is used, and I'd gather you could edit the DNS zone to remove it if you didn't want it web accessible for some reason.

    WHM:
    Create a New account:/ /home/[username]/public_html/ (is now a main domain)
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  3. #3
    bdominick's Avatar
    bdominick is offline I am a Glowru!
    Join Date
    Dec 2007
    Posts
    76

    Default

    Okay, the addons option works for now. Eventually I'll want to switch the primary domain to use the same doc root, but for now this works in a way I did not expect. Thanks Matt!
    Brian Dominick
    | WebRoot Solutions
    | Server Administrator, Software Developer
    http://mywebroot.com

  4. #4
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,208

    Default

    Quote Originally Posted by bdominick View Post
    Okay, the addons option works for now. Eventually I'll want to switch the primary domain to use the same doc root, but for now this works in a way I did not expect. Thanks Matt!
    If that's the case why not move:
    /home/[username]/public_html/subfolder

    To:
    /home/[username]/subfolder

    Then delete public_html, and rename subfolder to public_html

    That's the cleanest way to do it to make sure that it will be easily compatible with cPanel and not getting into httpd.conf

    That takes care of the main domain using the correct document root. The addon domain will break since its document root no longer exists but that is easy enough to fix by simply adding:

    /home/[username]/public_html
    /subfolder

    or removing the addon and parking it instead, on the main domain since that sounds like what you are trying to do anyways.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  5. #5
    bdominick's Avatar
    bdominick is offline I am a Glowru!
    Join Date
    Dec 2007
    Posts
    76

    Default primary domain redirect

    Okay, I followed Matt's instructions here and it worked PERFECTLY, just for the record. In fact, I was prepped well enough and had all my shell commands ready, so I did it in under 2 minutes. Smooth as silk. Thanks Matt!

    But there's more...

    So now, essentially, we are giving out seconddomain.com and if you use URLs based on that address, everything is great. But because we have some domain-specific scripts and apps, and licenses based on that seconddomain.com, we can't allow anyone to ever go to primarydomain.com or tertiarydomain.com ever again by HTTP. So I'm trying to do a .htaccess redirect. I found domain redirect instructions, which seem perfect for what I need. I've modified them a bit and tried them a few different ways, but to no avail.

    Here's what I'm trying:

    Code:
    RewriteEngine On
    
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^www.primarydomain.com$[OR]
    RewriteCond %{HTTP_HOST} ^primarydomain.com$[OR]
    RewriteCond %{HTTP_HOST} ^www.tertiarydomain.com$[OR]
    RewriteCond %{HTTP_HOST} ^tertiarydomain.com$
    
    RewriteRule ^(.*)$ http://secondarydomain.com/$1 [R=301,L]
    Remember, the secondary domain is a parked domain, and I can't change the accoun't primary domain (I'm pretty sure I can't, anyway...).

    Any help would be appreciated.
    Brian Dominick
    | WebRoot Solutions
    | Server Administrator, Software Developer
    http://mywebroot.com

  6. #6
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,208

    Default

    If you dont want access to the primary domain or tertiary domain, "ever" why bother having them configured? Why not convert secondary domain to primary domain, and get rid of the tertiary and current primary domain from the server configuration?
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  7. #7
    bdominick's Avatar
    bdominick is offline I am a Glowru!
    Join Date
    Dec 2007
    Posts
    76

    Default

    Quote Originally Posted by Matt View Post
    If you dont want access to the primary domain or tertiary domain, "ever" why bother having them configured? Why not convert secondary domain to primary domain, and get rid of the tertiary and current primary domain from the server configuration?
    Most people know the old domains. Tons of sites are linked there, and lots of people have bookmarked them. What I mean is I need browsers to request files at the secondary (parked) domain, even if they originally attempt to connect using the primary or tertiary domains. This is critical for cookies, etc. But we can't just eliminate the other domains that people still know.

    Anyway, you are saying there is a way to swap out the primary domain for the secondary domain? Everywhere I look says there's no way to do this with cPanel.
    Brian Dominick
    | WebRoot Solutions
    | Server Administrator, Software Developer
    http://mywebroot.com

  8. #8
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,208

    Default

    To make the secondary domain, the primary domain, unpark it or "un" addon it first in the primary domains control panel. Then go to WHM > modify an account and change the primary domain name to the secondary domain name.

    You now have the secondary domain as a primary domain. Then you can park the secondary and tertiary domains on the primary domain.

    Then from there if you want to setup a 301 permanent redirect like you are trying to attempt you can unpark these domains and make them addon domains then use .htaccess to make the 301 redirects.

    As far as the correct syntatx to use in .htaccess I am not able to help you there you'd need to make sure you are using the correct rules for the version of Apache you run as I don't think rules for 1.x work on 2.x and vice versa.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

Similar Threads

  1. SEO on Parked Domains
    By rlhanson in forum Search Engines Talk
    Replies: 14
    Last Post: 11-10-2008, 05:49 PM
  2. Parked godaddy page forwarded to ip address?
    By monkette in forum General Support
    Replies: 4
    Last Post: 05-01-2005, 04:12 PM

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14