html - allow access to only one php file with htaccess -
i have few media files in folder , php file on same folder, want deny access media file accessing directly, want access media files via php file there.
lets my_folder containing index.php, movie1.mp4, movie2.mp4 etc, want deny movie1.mp4 , movie2.mp4 straightly, need allow index.php
help me htaccess handling
you can ignore files using
rewriterule ^/?/file\.mp4$ - [f,l] you can utilize .htaccess . request redirected index.php in directory & request made mp4 files redirected index.php
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^/?/file\.mp4$ - [f,l] rewriterule . /index.php [l] </ifmodule> php html .htaccess
No comments:
Post a Comment