SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 33 of 33
  1. #26
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Ahh. Since you have more rewrite rules in your addon directory, you'll have to put this new rewrite rule in there as well, instead of in your root.

    RewriteCond %{HTTP_HOST} !^(www\.)?myaddondomain\.com [NC]
    RewriteRule ^(.*)$ http://www.myaddondomain.com/$1 [R=301,L]
    "First make it work. Then make it better."

  2. #27
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,657
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Don't want to step on anybody's toes here. Just trying to get to the bottom with the best code. So here are the two versions I have been given in here thread. Can you Jeff please explain to me (possibly again) why your couple different characters are better than the previous version I was given above? They are both basically the same eccept a couple little characters. Thank you sir.

    Code:
    RewriteCond %{HTTP_HOST} !^(www\.)?addondomain\.com$ [NC]
    RewriteRule .? http://www.addondomain.com/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} !^(www\.)?addondomain\.com [NC]
    RewriteRule ^(.*)$ http://www.myaddondomain.com/$1 [R=301,L]
    And Jeff I respect your opinion. Do you think it would be prudent to put this single domain (the only one that puts food on my table) in its own cpanel. And then just put all my other addon domains into another hosting account? The only benefit being being 100% sure there were never any mix ups as to which sub folders belong to which domain. Being that addon domains are treated as sub domains is is remotely possible google carried some site juice from one to the other. And one in particular I don't want ever associated with my main domain. In any way. Thanks!

  3. #28
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Well, for starters, I suspect there was a typo in what dklynn posted. He probably meant to write this:

    RewriteRule .? http://www.addondomain.com%{REQUEST_URI} [R=301,L]

    So the difference is the (.*)/$1 vs .?/%{REQUEST_URI}. My thoughts about that are above in post #22.

    Quote Originally Posted by PicnicTutorials View Post
    Do you think it would be prudent to put this single domain (the only one that puts food on my table) in its own cpanel. And then just put all my other addon domains into another hosting account? The only benefit being being 100% sure there were never any mix ups as to which sub folders belong to which domain. Being that addon domains are treated as sub domains is is remotely possible google carried some site juice from one to the other. And one in particular I don't want ever associated with my main domain. In any way. Thanks!
    Paying for two hosts seems like a bit of a waste. Personally, I'd rather have a host that let's me pick where each domain, subdomain, and addondomain will live in the filesystem. And if HostGator doesn't let you do that...

    That being said, I did some quick googling, and it looks like HostGator does let you pick where the subdomains/addondomains will live -- http://support.hostgator.com/article...ng-a-subdomain. It sounds as though /public_html/{subdomain} is only a suggested location, and you can actually set the document root to anywhere.
    "First make it work. Then make it better."

  4. #29
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,657
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    Well, for starters, I suspect there was a typo in what dklynn posted. He probably meant to write this:

    RewriteRule .? http://www.addondomain.com%{REQUEST_URI} [R=301,L]

    So the difference is the (.*)/$1 vs .?/%{REQUEST_URI}. My thoughts about that are above in post #22.



    Paying for two hosts seems like a bit of a waste. Personally, I'd rather have a host that let's me pick where each domain, subdomain, and addondomain will live in the filesystem. And if HostGator doesn't let you do that...

    That being said, I did some quick googling, and it looks like HostGator does let you pick where the subdomains/addondomains will live -- http://support.hostgator.com/article...ng-a-subdomain. It sounds as though /public_html/{subdomain} is only a suggested location, and you can actually set the document root to anywhere.
    Looks like this in the coments is what your talking about. Interesting I'll have to confirm what that means. You now what that means?

    QUESTION
    "Is it possible to have a seperate document-root for the subdomain which is NOT in the document root of the main-domain?

    If not, how can I protect the directory to make it accessible as subdomain.domain.com and not accessible trough domain.com/subdomain?"

    ANSWER
    "Yes, what you propose will work. I do that often with my Addon domains.

    Just create the domain as normal, but in the Document Root path, remove "public_html/" and just type the folder name. The root folder will appear outside of public_html."

    I got the answer...

    You cannot change the document root of the primary domain, as stated in the "Document Root Changes" article.

    However, I have an advanced trick for you! When you create your addon domains, choose the Document Root for those to be outside of public_html (erase "public_html/").

    EXAMPLE:
    New Domain Name: addondomain.com
    Document Root: public_html/addondomain.com

    Change that to...
    Document Root: addondomain.com

    Now when you create it, the addon domain cannot be seen as part of the primary domain, even by those who know the site structure.

  5. #30
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,657
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    But you wrote

    RewriteRule .? http://www.addondomain.com/$1 [R=301,L]

    So should I that or this

    RewriteRule .? http://www.addondomain.com%{REQUEST_URI} [R=301,L]

  6. #31
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PicnicTutorials View Post
    But you wrote

    RewriteRule .? http://www.addondomain.com/$1 [R=301,L]

    So should I that or this

    RewriteRule .? http://www.addondomain.com%{REQUEST_URI} [R=301,L]
    The first one is what dklynn wrote. The second one is what dklynn probably meant to write. And then this one is mine...

    Code:
    RewriteRule ^(.*)$ http://www.myaddondomain.com/$1 [R=301,L]
    "First make it work. Then make it better."

  7. #32
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PicnicTutorials View Post
    Looks like this in the coments is what your talking about. Interesting I'll have to confirm what that means. You now what that means?
    It means that your subdomains/addondomains don't need to live inside your maindomain.
    "First make it work. Then make it better."

  8. #33
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,657
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    It means that your subdomains/addondomains don't need to live inside your maindomain.
    Ya I got it. Thank I did not know that. From what I can tell it would just prevent the addon from being accessed via main/addon. May addon.main too I guess. I'll have to talk to histgator about this .


Bookmarks

Posting Permissions

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