Yeah when I got this all working it just goes in a loop.
So it requests the file.mp4 then it redirects to the count.php grabs the file path
I sent with the htaccess file. But since I still need that mp4 file to be displayed
when I use header('Location: x.x.x' ); in the php file to send the browser back
to that file for playing it gets sent right back to count.php and when I check the
db count on that it is raised by a hundred in few seconds so I can see it just
goes in circle.
What I need to say is that if the referer is
http://domain.com/dir/count.php goto mp4
file otherwise redirect to the count.php file.
This is what I am trying but not working. I also tried redirecting the mp4 file with a query
string attached like
http://domain.com/dir/joe.mp4?p=1 and then redirecting based on
the query string but no luck on that.
RewriteCond %{QUERY_STRING} ^p=1
RewriteRule /* {REQUEST_FILENAME} [R,L]
RewriteRule ^(.+)$ http://domain.com/count.php?id1=%{REQUEST_FILENAME}&id2=$1 [R=301,L]