Closed Thread
Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By descalzo

Thread: Addon Domain Document Root Directory

  1. #1
    steve.ancheta32 is offline x10Hosting Member steve.ancheta32 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    4

    Addon Domain Document Root Directory

    a blessed day to all,

    I want to host another domain on my hosting account. I want to organize my websites by putting them on separate folders on my account root directory. but every time I add a domain and removing public_html on the document root path, it will still put the addon domain document root path inside public_html.

    The reason I need this is because example I put my second domain to public_html/seconddomain folder, i don't want anybody to access the second domain site by www.primarydomain.com/seconddomain.

    Many thanks in advance.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: Addon Domain Document Root Directory

    that is the way that the system is set up here. You cannot avoid it.

    What you can do is use the htaccess file in public_html to bar entry to the subdomain via the main domain.

    Edit/Correction:

    Use the .htaccess in the subdirectory containing the add-on

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?yourmaindomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.yourparentdomain.com [R=301,L]
    This way, if they are entering the sub-directory via the maindomain, they will be redirected to the front page of the main domain (you can send them to anypage).
    Last edited by descalzo; 08-30-2011 at 04:23 PM.
    steve.ancheta32 likes this.
    Nothing is always absolutely so.

  3. #3
    steve.ancheta32 is offline x10Hosting Member steve.ancheta32 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    4

    Re: Addon Domain Document Root Directory

    Thank you so much descalzo for your quick response. I appreciate it so much. And thanks for clarification regarding my hosting account and thank you for the instruction. I will try to do it now.

    Another question, if is it possible to change the root directory folder of my main domain to a folder inside public_html? But not by using cPanel>Domains>Redirects. so that I will only see my maindomain folder and addondomain folder inside my public_html folder. I just want it to be neat.

  4. #4
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: Addon Domain Document Root Directory

    public_html will be the document root for your main domain.

    It is doable through .htaccess to use a subfolder as document root for the main domain though, let me see if I can round up where I found the info when I was looking for it.

    ADD: Believe this is where I found the info when I needed it a while back: http://www.zimplicit.se/knowledge/ho...using-htaccess (site is Swedish, but the important information is in English)
    Last edited by Anna; 08-31-2011 at 03:26 PM.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  5. #5
    steve.ancheta32 is offline x10Hosting Member steve.ancheta32 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    4

    Re: Addon Domain Document Root Directory

    Thank you so much anna for your quick response. I'm very impress with the help that x10hosting is giving even if the service is free.

    I have done the instruction but I'm having 404 error message always.
    I have done some research but they have also the same instruction.
    I posted here my .htaccess i think this will be needed for you to help me.
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?kenya.x10.mx$
    RewriteCond %{REQUEST_URI} !^/kenya.x10.mx/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /kenya.x10.mx/$1
    RewriteCond %{HTTP_HOST} ^(www.)?kenya.x10.mx$
    RewriteRule ^(/)?$ kenya.x10.mx/index.html [L]
    Just for testing I only put now one file on the "kenya.x10.mx" subdirectory which is index.html with a basic hello world code.

    Add: I tried it on another webhosting company and it works. Maybe something to do with Lotus server that causing me this 404 error..?
    Last edited by steve.ancheta32; 09-01-2011 at 10:46 AM.

  6. #6
    steve.ancheta32 is offline x10Hosting Member steve.ancheta32 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    4

    Question Re: Addon Domain Document Root Directory

    Dear x10Hosting admins,

    I humbly ask for any feedback regarding 404 error after I edit the .htaccess file as per instruction.

    Sincerely,
    Steve

Closed Thread

Similar Threads

  1. php include file using document root
    By funkymunky20079 in forum Free Hosting
    Replies: 3
    Last Post: 06-09-2011, 08:44 AM
  2. want to set up main public_html directory to addon domain.
    By mjangir7095 in forum Free Hosting
    Replies: 0
    Last Post: 02-23-2011, 10:39 PM
  3. Parked Domain Document Root
    By xeross in forum Free Hosting
    Replies: 0
    Last Post: 06-06-2008, 03:38 AM
  4. Document root
    By thezone1 in forum Free Hosting
    Replies: 8
    Last Post: 03-18-2008, 10:31 AM
  5. Replies: 1
    Last Post: 11-09-2007, 05:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers