Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: .htaccess

  1. #1

    Arrow .htaccess

    Hi,

    I would like to know how to setup .htaccess so that my main site's base folder is in a subfolder of public_html.

    In other words:
    Code:
    /home/myaccount/public_html/subfolder1 (for my main domain)
    /home/myaccount/public_html/subfolder2 (for my first addon domain)
    /home/myaccount/public_html/subfolder3 (for my second addon domain)
    but when I access my main domain from a browser, I do not want it to show that I am redirecting:

    I want to see:
    http://www.mymaindomain.com/
    and not http://www.mymaindomain.com/subfolder1

    Same applies to the addon domains.

    Thanks!
    jacauc

  2. #2
    Join Date
    Feb 2006
    Location
    Denmark
    Posts
    41

    Default

    That's mod_rewrite you'll need. Basicly in your .htaccess file there should be (haven't tested it:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^/$ /subfolder1/$1
    Dan Schultzer

  3. #3
    Join Date
    Feb 2006
    Posts
    17

    Default

    i want to get this workin as well on my site cant seem to figure it out..

    ok which htaccess file do i edit tho the root dir or the add on dir?


    I tried the the code but didnt work .. i edited the add on htaccess not the root

  4. #4
    Join Date
    Feb 2006
    Posts
    167

    Default Well...

    That actually is a way to edit the .htaccess but to actually set teh DocumentRoot it's a much more difficult process. You will need to impliment mod_rewrite to achieve "Masquerading".

    The process itself I'm not really sure of myself but it requires deep implimentation, and, alot of pain :P You will need to do some work with your .htaccess files, since one a shared server environment, you can't use DocumentRoot or any .htaccess extension like that.

    I can take a look into it a bit and see what results I can dig up, just because I am obsessive about that kind of thing. If anyone else successfully completes masquerading please feel free to share.
    I may not be smart enough to do everything, but I'm dumb enough to try anything.

    PS I no longer work for Bluehost, any posts from me may not be official company policies or views and should not be associated with Bluehost.

  5. #5

    Default

    Well, I would've thought everyone would want this, because without it, you'd have your addon domain subfolders mixed inbetween your main domains folders... can get cluttered :S

    Is this how most people work?

    That's mod_rewrite you'll need. Basicly in your .htaccess file there should be (haven't tested it:
    Oh, ya - mod_rewrite would be necessary for rewriting the URL, but I'd also have to do some redirect to get to the actual page.
    Is this done with the "redirect" statement, and how??
    Last edited by jacauc; 02-12-2006 at 09:42 PM.

  6. #6
    Join Date
    Feb 2006
    Location
    Denmark
    Posts
    41

    Default

    Hmm, what exactly do you want? Sounds like you just have to park the domain? I see no problem in having subfolders to my add-on domain in the main domain folder.
    Dan Schultzer

  7. #7

    Default

    Well, it is a cleaner approach.

    Let say "hypothetically" I want to delete the entire contents of my main domain, I could go into /public_html/subfolder1/ and execute "rm -rf"

    This will delete everything in that folder including subfolders.

    Now let's say I do this, but I do it in the public_html folder, I would delete everything including my addon domains.. everything!

    I like it to be structured and kept seperate.

  8. #8
    Join Date
    Feb 2006
    Location
    Denmark
    Posts
    41

    Default

    Ah, yeah. Not sure if this is possible though, but try submit a ticket at Bluehost Support (so you can have add-on domain folders at /). And tell us how it went
    Dan Schultzer

  9. #9

    Default

    It's Just the opposite I want. Don't want addons in / I want maindomain to behave like an addon and be in a subfolder.

  10. #10
    Join Date
    Feb 2006
    Posts
    167

    Default

    Our support probably wouldn't be able to help out there, as it requires detailed scripting (which, again, not even sure of 100% the actual scripting needed) so we wouldn't really be able to set that up.

    I briefly looked into it last night but I will do some more research later on today.
    I may not be smart enough to do everything, but I'm dumb enough to try anything.

    PS I no longer work for Bluehost, any posts from me may not be official company policies or views and should not be associated with Bluehost.

Posting Permissions

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