Co-domains rewrite engine

i know that there are like a thousand threads about this, but i still don't get it

I want to have a few co-domains that are redirected to a directory within my /web.

For example, i've got the domain www.domain.tld and i've just created test.domain.tld in the co-domain section of that domain in ispconfig.
Now i've created a .htaccess file in the root of my website and entered the following lines in there:

I am having a similar problem. Links on pages within the co-domain are redirecting to the master domain and its sub-folders. Co-domains with links are supposed to link to the Co-domain and its sub-folders.

What I get:sub.domain.tld with a link to something.html in the same folder redirects todomain.tld/subdomain/something.html instead of sub.domain.tld/something.html

Those apache directives don't seem to change anything. I think you might have pointed me in the right direction though. I will look into how to use apache directives better and see if I can't come up with something that works.