1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bandwidth Theft Question?

Discussion in 'Off Topic' started by kuyenmotdivad, Oct 22, 2010.

  1. kuyenmotdivad

    kuyenmotdivad Active Member

    Hi,

    How come if I put a .htaccess file in the root to protect from bandwidth theft and install XF in /community/ the script in the root will not protect the /community/ folder unless I had that .htaccess file in that folder as well?

    EG - I have to scripts exactly the same here.

    /.htaccess
    /community/.htaccess

    Any ideas?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It should work.
    I have hotlinking enabled on my domain and only the root .htaccess is required.
     
  3. kuyenmotdivad

    kuyenmotdivad Active Member

    Should I show you what I have in my file via a PC or post them here so you can have a look?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    This is what I have in mine.

    Code:
    RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ images/hotlink.jpg [L]
     
  5. kuyenmotdivad

    kuyenmotdivad Active Member

    I got this....

    /community/.htaccess
    PHP:
    <IfModule mod_rewrite.c>
      
    RewriteEngine On

       RewriteCond 
    %{REQUEST_FILENAME} -[OR]
      
    RewriteCond %{REQUEST_FILENAME} -[OR]
      
    RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule 
    ^.*$ - [NC,L]
      
    RewriteRule ^(data|js|styles|install) - [NC,L]
      
    RewriteRule ^.*$ index.php [NC,L]
    </
    IfModule>
     
  6. David McHenry

    David McHenry Active Member

    IF YOU HAVE AN .HTACCESS FILE FOR XENFORO IN YOUR COMMUNITY DIRECTORY THEN THE ROOT .HTACCESS WON'T OVERRIDE OR AUTOMATICALLY APPEND ITSELF TO IT. (OR ANY OTHER SUBFOLDER FROM ROOT.
     
  7. kuyenmotdivad

    kuyenmotdivad Active Member

    but I have to have one in /community/ as theres one included with this content. So I'm stuck with both .htaccess files with the same content in them both (partly)

    PHP:
    <IfModule mod_rewrite.c>
        
    RewriteEngine On

        RewriteCond 
    %{REQUEST_FILENAME} -[OR]
        
    RewriteCond %{REQUEST_FILENAME} -[OR]
        
    RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule 
    ^.*$ - [NC,L]
        
    RewriteRule ^(data|js|styles|install) - [NC,L]
        
    RewriteRule ^.*$ index.php [NC,L]
    </
    IfModule>
     
  8. kuyenmotdivad

    kuyenmotdivad Active Member

    The .htaccess file thats included with XF would it be better to put all files in my /community/ folder and the XF .htaccess in my root, like this?

    /.htaccess (including the lines from the XF .htaccess)
    PHP:
    <IfModule mod_rewrite.c>
        
    RewriteEngine On

        RewriteCond 
    %{REQUEST_FILENAME} -[OR]
        
    RewriteCond %{REQUEST_FILENAME} -[OR]
        
    RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule 
    ^.*$ - [NC,L]
        
    RewriteRule ^(data|js|styles|install) - [NC,L]
        
    RewriteRule ^.*$ index.php [NC,L]
    </
    IfModule>
    /community/ (all other files here but not the .htaccess file)
     
  9. David McHenry

    David McHenry Active Member

    THE ONLY PART THAT WOULD BE DOUBLE IS THE PART FOR HOTLINK PROTECTION.

    IN YOUR ROOT .HTACCESS
    Code:
    
    RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ images/hotlink.jpg [L]
    
    
    THEN IN YOUR /COMMUNITY/.HTACCESS
    Code:
    XENFORO DEFAULT HTACCESS
    RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ images/hotlink.jpg [L]
    
    ALSO ITS INTERNATIONAL CAPS LOCK DAY. HENCE MY CONSTANT USAGE OF CAPSLOCK
     
  10. kuyenmotdivad

    kuyenmotdivad Active Member

Share This Page