allow,deny ...help

Discussion in 'Installation/Configuration' started by Boon-Dog-Danny, Apr 8, 2008.

  1. Boon-Dog-Danny

    Boon-Dog-Danny New Member

    hello

    I have a site that uses lots of video.. example files being somefile.flv, somefile.wmv, somefile.asf

    I am trying to make it so only my website can use these files yet I cant seem to stop the video files using htaccess.. I was reading that changing this

    Order allow,deny
    Allow from all

    to

    # Order allow,deny
    # Allow from all
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1

    this could help .. my question is.. where do I change this?
    the etc/apache2/apache2.conf file?

    and how? do I use something like this?

    <FilesMatch "\.(wmv|asf|asx|swf)$">
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    </FilesMatch>

    thanks for any help
     
  2. falko

    falko Super Moderator ISPConfig Developer

    You can put an .htaccess file like this into your video directory:

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?myfirstsite.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysecondsite.net [NC]
    RewriteRule \.(flv|wmv|asf)$ - [NC,F,L]
    This would block all requests that don't come from myfirstsite.com or mysecondsite.net or have an empty referer.
     
  3. Boon-Dog-Danny

    Boon-Dog-Danny New Member

    thanks Falco.. that seemed to do the trick..you rock!
     

Share This Page