Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Htaccess - Hotlinking, Banning, Coding -

    Hey Coding Comrades,
    I have been following the tutorials available on javascriptkit.com and just noticed they had a forum! How fantastic!
    I have been trying to understand Htaccess for a couple of months, and would love to run my code by the professionals

    So... what I am trying to do is block people from hot linking my media (mp3, avi, wmv, png, gif, jpg) as well as disable Directory Searching.

    So after reading the lovely tutorial available on javascriptkit.com, I have a question...

    When blocking websites from accessing your site you use:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} anotherbadsite\.com
    RewriteRule .* - [F]

    But! When I am trying to douse all hotlinking, I want to use this:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/.*$ [NC]
    RewriteRule \.(gif|jpg|wmv|avi|mp3|png|mov)$ - [F]

    Is the latter going to overwrite the former? Because the coding is pretty much the same thing. SO, it's my understanding that the first bit of code is to make the "bad sites" not be able to access my website, and the second part of the code is to make my site the only own who can access all the media. Is my understanding correct?

    My last question is on Index searching... by placing this code in my htaccess:

    IndexIgnore *.gif *.jpg *.wmv *.avi *.mp3 *.png *.mov

    Am I correct in saying all my media will not show when someone accesses my directories?

    Thank you so much for your time and patience guys,
    I really do appreciate your help.

    With warmest regards,
    Laura

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    whither xml?
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To be honest Shyam, I didn't know where to put this thread.
    So I did a forum search and posted where most of the Htaccess stuff seemed to be.

    Can you direct me to a correct spot if I'm in the wrong place?
    I appreciate your reply!
    Thank you,
    Laura

  • #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,453
    Thanks
    1
    Thanked 21 Times in 19 Posts
    Moved to Server side development.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #5
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    [QUOTE=lmabee;645457]
    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} anotherbadsite\.com
    RewriteRule .* - [F]

    Quote Originally Posted by lmabee View Post
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/.*$ [NC]
    RewriteRule \.(gif|jpg|wmv|avi|mp3|png|mov)$ - [F]

    Is the latter going to overwrite the former? Because the coding is pretty much the same thing. SO, it's my understanding that the first bit of code is to make the "bad sites" not be able to access my website, and the second part of the code is to make my site the only own who can access all the media. Is my understanding correct?

    IndexIgnore *.gif *.jpg *.wmv *.avi *.mp3 *.png *.mov

    Am I correct in saying all my media will not show when someone accesses my directories?
    2 points scored 1 for each correct answer
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •