Hi there, i just setup a subdomain "data.domain.org".Now i want to track my page with an analytic-tool - this is functional with this structure:- i only share links on the internet with the url to e.g. "domain.org/img/1.jpg"- this page includes a 404.php, in which the javascript of the analytic-tool is in it - this 404.php redirects to "data.domain.org/img/1.jpg"

So, normally this is, what i want! BUT: if someone shares the link on his own, he will share it with the subdomain and then the javascript won't be run und i can't track my visitors, 'cause the directlink...

Now i want to fix this problem with mod_rewrite, that on demand of e.g. "data.domain.org/img/1.jpg" the user gets redirected to "domain.org/img/1.jpg" - then the 404.php gets included and the anayltic-tool tracks this visitor - to exit the loop mod_rewirte should only fire on a referer that is not domain.org.

This is my test-code in .htaccess (without referer-check but thats simple, i hope )