I have set my dns CNAME records for a subdomain and I’ve set up my virtualhost in Apache http-vhosts.conf like so:
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /opt/lampp/htdocs
ServerName www.example.com
ServerAlias example.com *.example.com
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
</VirtualHost>
<Virtualhost *:80>
ServerAdmin admin@example.com
DocumentRoot /opt/lampp/htdocs/subdomain
ServerName subdomain.example.com.com
ErrorLog logs/subdomain.example.com-error_log
CustomLog logs/subdomain.example.com-access_log common
</Virtualhost>
What ends up happening is that when I go to subdomain.example.com it starts in the htdocs instead of htdocs/subdomain/ directory. I want it to start in /htdocs/subdomain/ and I cannot figure out how.
Please help, I'd really appreciate it.