How to track htaccess redirect?

I have htaccess redirect on mysite.com/pageid=1 to affiliate-offer.com.
Piwik don’t track it when i put javascript code.
Is there anyway to track that page with htaccess redirect?

Regards

bump.Suggestion, anyone, please?

I would recommend using a different method than .htaccess redirect.

The Javascript needs to fire in order for the track to be recorded, however the redirect will happen before that gets loaded.
So I’d suggest removing it and just adding in a meta refresh after 5 seconds or something.

You can use PHP API to do tracking but I feel like the JS way will be easier.