Forum Moderators: phranque
I have an application that uses one domain for two seperate things.
The first is a website in the front used for information and signups.
The second is a backend system that is coded.
What I need to know is how to use apache's config to set redirection to the app folder when there is a subdomain present.
For instance, I have...
/home/acctName/public_html
This is the visible site and it's info, signup, etc.
/home/acctName/application/public_html
This is the application end...it looks at the domain, pulls the subdomain and uses that as the account marker.
I am looking for a server-side look at the presence of the subdomain (non www.), and then redirect to force the application folder as the root, and not the existing as the root.
Any help is greatly appreciated. Thank you in advance!
I've already started looking into virtualhost and those directives, but I am still getting a problem with all of the hosts(even without the subdomain) directed to the other directory.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName servername.somedomain.com
DocumentRoot /home/subdomain/app/public_html
</VirtualHost>
when I put in somedomain.com, I get redirected to the app, and when I use dev.somedomain.com(which is a legit account name), I get an 'oops' message from the browser.
Any help is greatly appreciated, and thanks in advance.
Also see Apache virtual hosts documentation [httpd.apache.org].
Jim