Forum Moderators: phranque

Message Too Old, No Replies

Trying to modify httpd.conf document_root

         

erikcw

11:00 pm on Sep 22, 2004 (gmt 0)

10+ Year Member



Hi.

I have an addon domain (cPanel) that I am trying to get to point to /home/user/public_html/ instead of the defualt /home/user/public_html/subdomain/

I went into httpd.conf and changed the Document_Root for the addon domain to point to public_html/ then restarted apache - it worked GREAT! EXCEPT - after a few moments, instead of showing the addon domain in the address bar, it starts "redirecting" to the "parent domain" How do I make it stick?

Both domains are supposed to show the identical content, but I am using php to examine which HTTP_HOST the request is coming from and displaying the right logo based on that...

Any Ideas!
Erik

encyclo

11:44 pm on Sep 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How have you added the domain in httpd.conf, erik? As a subdomain or as a server alias?

If you are using virtual hosts, the easiest is just to add a ServerAlias in the VirtualHost directive for the first domain - something vaguely like:

<VirtualHost *>
DocumentRoot "/home/user/public_html"
ServerName example.com
ServerAlias example.org
</VirtualHost>

erikcw

2:06 am on Sep 23, 2004 (gmt 0)

10+ Year Member



I've tried ServerAlias, but when you type in the alias, it doesn't "stick" in the address bar, it just redirects to the main URL. I don't want my users to see the main URL...