I would like any directory *.example.com (bar.example.com, foo.example.com, etc..) to direct to the folder /home/user/htdocs/subdir/
www.example.com and example.com should remain unaffected.
Is this possible with htacecss, or another route?
I would like any directory *.example.com (bar.example.com, foo.example.com, etc..) to direct to the folder /home/user/htdocs/subdir/
www.example.com and example.com should remain unaffected.
Is this possible with htacecss, or another route?
You could do this by setting up two virtual hosts via the Apache configuration. For example:
After the declaring in your Apache configuration file the directives for www.example.com and example.com, you can set an extra
VirtualHost
entry with any subdomain asServerName
and a wildcardServerAlias
like so to point every subdomain there.Note: You must declare a servername (any would do)