In Apache conf’s Servername setting, I need to specify a directory.
Such as Servername http://www.example.com/directory. I trid and it does not work, though.
I have a main site (www.example.com) which documentroot is /var/www/html/main and my sub site URL is http://www.example.com/sub and its documentroot is /var/www/html/sub.
Thank you.
www.example.com/directoryis not a valid value forServerName. Only hostname and port can be included in the value forServerName.What you want to define is called an
Alias. You can read aboutAliashere.For example, inside of your configuration for
www.example.com, you can add this line:Alias /sub /var/www/html/sub