Jump to content

How to change Document Root of addon domain ?


Recommended Posts

Posted

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 ?

 

 

 

 

 

Posted

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.

Posted

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

 

Posted
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?

 

 

Posted

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

 

Posted
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.

 

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...