Hello
I've searched around google for quite some time and haven't found exactly my problem but only simillar answers that didn't worked.
I am using .htaccess to host multiple domains on one ip address.
The main ip address is allocated for domain.com (as example)
so we have /var/www and folders created for each domain
/var/www/site2
/var/www/site3
I'm using htaccess to point separate domains such as seconddomain.com to show /var/www/site2 content and thirddomain.com to show /var/www/site3 content. Everything works fine here.
But if i try for example to visit domain.com/site2 or domain.com/site3 i would like to redirect to their domains instead of showing content under the current address domain.com/site1 or domain.com/site2.
So when people would visit domain.com/site2 it should automatically redirect to it's own domain name which is secondarydomain.com (same applies for site3 example)
Also remember everything is on the same host and ip address so by accessing secondarydomain.com i would see the /var/www/site2 content and by accessing domain.com/site2 it should redirect to the same secondarydomain.com in address bar which would list thye same /var/www/site2 content