i have some links
example.com/1.mp4
example.com/2.mp4
is there a way to block accessing directly to those files but allow just if u add this
example.com/1.mp4?token=12345
so all mp4 files can be access only if u add ?token=12345 at end
so without it
RewriteCond %{QUERY_STRING} !^token=12345
RewriteRule ^.* - [F,L]
i tried this but is not working, so i want those mp4 to be played on vlc or any other player just if ?token=12345 is presend otherwise redirect to any other video
What you had should work. Try this:
That will return forbidden on
.mp4
files unlesstoken=12345
is present. As for redirecting to a video, you could do that with:Replacing
/video
with the path to the video. Make sure it's not.mp4
or you'll get a loop.Let me know any problems.