Forum Moderators: phranque
If you're on shared hosting, and have used a "control panel" to set up the sub.domain1.com hostname as an "add-on domain", then an internal rewrite from domain2.com to sub.domain1.com's filespace is all that is needed. However, if it is domain2.com that has been declared as an add-on to sub.domain1.com (or to domain1.com), then no solution may be possible unless you switch from a name-based virtual host to an IP-address-based virtual host...