Jump to content

How to change Document Root of addon domain ?


Arvind

Recommended Posts

Hello,

 

currently my addon domain is pointing to 'public_html/addon.domain/'

 

I want to move it out of public_html and put it in a directory which is a peer to public_html. How can i do this ?

 

The reason being ... people can access my addon domain with this url.

http://defaultdomain.heliohost.org/addon.domain/

 

I want to prevent this, as it looks odd. its reveals the directory structure of my hosting and it can cause issues to applications hosted on the domain, as,

it might break the application because, the home directory is no longer 'http://addon.domain/application' but

'http://defaultdomain.heliohost.org/addon.domain/application'.

 

Can anybody please throw some light on this ?

 

 

Arvind

 

 

p.s. is the wwwroot a link to the public_html directory ?

 

 

 

 

 

Link to comment
Share on other sites

Your best bet is to edit the .htaccess of your addon domain's root folder so that it will only display "addon.domain" or perhaps block traffic coming in from "defaultdomain.heliohost.org/addon.domain". However I'm not quite sure how to do this, and I don't have time to dig around in apache documentation to help. Try the Oracle.

 

P.S. WWW is indeed a link to public_html.

Link to comment
Share on other sites

Hello,

 

Yes, i thought of the .htaccess file.. but then, that will always push you to one domain.

 

What if you were to delete a domain and recreate the domain ? then can we change the document root ?

or will that entail more work for heliohost admins ? I dont want to do such anything to make extra work for the admins.

they are already doing a great great job, by providing us with this superb hosting.

 

I am looking into blocking traffic with some URL rewriting in .htaccess :-). great idea.

 

Arvind

 

Link to comment
Share on other sites

I want to move it out of public_html and put it in a directory which is a peer to public_html. How can i do this ?

 

You can't create a directory out of the public_html. The only other place you can create directories is in your home directory and nobody but you can see those. How would anybody know your default domain anyway?

 

 

Link to comment
Share on other sites

Hello,

 

Can I not have a directory in my home directory which is the document root of a hosted domain ?

Say, if i have foo.com, why should foo.com be inside /public_html/foo.com/ ?

if I make /HOMEDIR/foo.com and point that domain's document root in the cpanel as /HOMEDIR/foo.com wont that work ?

 

The issue was that, my domain was being accessed as

http://myaccount.heliohost.org/foo.com/ which would cause application errors as the root for my application has changed...

 

adding this to the .htaccess in the /public_html/foo.com

 

Redirect /foo.com http://www.foo.com

 

I find that, anybody who accesses

http://myaccount.heliohost.org/foo.com/

 

is automatically redirected to

http://foo.com/

 

This solves a lot of issues.

 

thanks

Arvind

 

Link to comment
Share on other sites

if I make /HOMEDIR/foo.com and point that domain's document root in the cpanel as /HOMEDIR/foo.com wont that work ?

 

It won't be for the public to see. It will still be in your home directory where only you can see it.

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...