Issue :
While accessing the subfolder of an addon domain using
httpd://www.addondomain.com/subfolder
the URL changes to
httpd://www.subdomain.maindomain.com/subfolder
but at the same time,
httpd://www.addondomain.com/subfolder/ (the one with trailing slash) works fine.
Fix :
This issue can be fixed by changing the ServerName entry in httpd.conf.
Change
ServerName subdomain.maindomain.com
to
ServerName addondomain.com