Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 04-06-2007, 10:26 AM
topncal topncal is offline
Hatchling Croc
 
Join Date: Apr 2007
Posts: 1
Lightbulb Moving the document root

I don't know if this can be done, But I host multiable domains as many of us do.What I am trying to do is move my document root for the main account domain into a sub folder. SO it will look something like this.

/public_html/MAINSITE
/public_html/Second_Site
/public_html/third_site

Is this possible to move my main site into a subdomain and have it directed correctly? It just seems like it would keep everything looking neat and tidy.
Reply With Quote
  #2  
Old 04-06-2007, 01:11 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Moving the document root

It doesn't work that way, sorry. If you need multiple roots, then you need a reseller account.

Part of what you need done can be done with sub/addon domains, but you can't mess with the main domain. (as a shared user).
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #3  
Old 04-06-2007, 01:39 PM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,921
Default Re: Moving the document root

I think what you're looking for is the neat and tidyness...

You could put all the files for your main site into a folder called mainsite, then have the /public_html/index.html file redirect to that folder. Everything you acess would then be domain.com/mainsite/ and you'd have to make sure your coding was correct.

Then secondsite and thirdsite would be folders as add-on domains as setup now.

Like Serra said though, it's not actually multiple roots.

I think this would work, because you're looking for the neat and tidyness. It's really not worth the time though -- too much work for no real reason, because you'd have to make sure all your paths instead your /mainsite/ were correct.

You'd be better off moving to reseller if you really want it that tidy.
Reply With Quote
  #4  
Old 04-06-2007, 10:07 PM
billyen billyen is offline
Hatchling Croc
 
Join Date: Jun 2006
Posts: 6
Default Re: Moving the document root

As kmaw said, it's possible to put the main site content in a subdirectory of /public_html and use .htaccess / mod_rewrite to get the correct content displayed.

However, for SEO I suspect it is preferable to have http:/www.domain.com as your home URL rather than http:/www.domain.com/mainsite/.

I'm trying to do the same as you but not display the subdirectory's name in the URL. I almost have this working on my Swamp account.

I'd like to offer more concrete advice but my case has another twist:

In addition I'm trying to set https://www.domain.com/ as my canonical domain name (my SSL cert is for www.domain.com) and redirect all http:// URLs to the secure site. My current redirect solution works in 3 out of 4 of the possible cases. I'll let you know if I find a comprehensive solution.

My best advice at the moment is to visit http://www.webmasterworld.com/apache/ There's a wealth of information there and a guru calledjdMorgan in particuar.I suspect I'll be posting there later today myself.

(FYI Serra/kmaw: 1) I'm doing this mainly for organizational purposes and to avoid accidentally messing things via my FTP browser plus it looks nice . 2) The main reason for not going reseller is to allow use of a common script library.)

Last edited by billyen; 04-06-2007 at 10:25 PM.
Reply With Quote
  #5  
Old 04-07-2007, 09:03 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Moving the document root

Quote:
Originally Posted by billyen View Post
(FYI Serra/kmaw: 1) I'm doing this mainly for organizational purposes and to avoid accidentally messing things via my FTP browser plus it looks nice . 2) The main reason for not going reseller is to allow use of a common script library.)
Yes, it is possible to do that, but... its possible to do a lot of things that simply are really bad ideas.

When doing it specifically to make the directory structure "look nice", it borders on being, well... insane.

It would be far better to get an FTP program that allows you to use ftp without the possibility of messing things up, than to change the default structure of public_html. Many programs will depend on the directory structure being normal and that could cause you great problems in the future, but, hey, if you hear voices in your head telling you to do it, go ahead, just ignore the voice when they tell you to do 'bad' things.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #6  
Old 02-18-2009, 09:51 AM
Wayne Sallee's Avatar
Wayne Sallee Wayne Sallee is offline
Baby Croc
 
Join Date: Oct 2007
Location: Florida
Posts: 87
Default Re: Moving the document root

Quote:
Originally Posted by topncal View Post
I don't know if this can be done, But I host multiable domains as many of us do.What I am trying to do is move my document root for the main account domain into a sub folder. SO it will look something like this.

/public_html/MAINSITE
/public_html/Second_Site
/public_html/third_site

Is this possible to move my main site into a subdomain and have it directed correctly? It just seems like it would keep everything looking neat and tidy.

Yes, you can do this. It's simple. It's how I have mine set up.

Just send e-mail to support@hostgator.com, and ask them to modify the document root directory for the primary domain. And give them the directory name that you want it to be.

This method works very well with no problems. In my opinion, it's the preferred method, but then that's just my opinion. :-)

Here is a sample e-mail that you can send them:

***********
Please modify the document root directory for the primary domain myprimarydomain.com to /public_html/myprimarydomain

I want the main domain, and the subdomains, to be in the same directory order. It helps keep things more efficient.
************

Yea, I know this is an old thread, but this post is for people like me that search through old posts for information. And there is probably someone reading this right now that has been wanting to know this.


Wayne Sallee
Wayne@WayneSallee.com


*edit: But now after posting I realize that this thread is not in an appropriate forum. Maybe someone can move it to a more appropriate forum.

Last edited by Wayne Sallee; 02-18-2009 at 09:56 AM.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 10:33 PM.