Casual Articles
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Advanced Hotlink Protection

Tags

  • images
  • resources
  • rewriteengine
  • custom error
  • referer searchqcache

  • Links

  • Characteristics of the Golden Retriever
  • Pilates, Exercise, & Osteoporosis (Part 4)
  • How to Bet on Baseball
  • Casual Articles - Advanced Hotlink Protection

    Brand Your Practice On The Web
    Design your Web site so that it appeals to prospective patients—and the search engines that bring them to you.Jessica has recently been considering plastic surgery. At age 26, she realizes that she has small rolls on her waist, and that “little bit” of extra girth on her thighs is just not going to go away despite how much she diets and works out at her gym. Her breasts are starting to sag just a bit, and they were never as full as she would have liked.She recognizes that plastic surgery has become increasingly accepted, and she no longer considers it vain but rather an alternative to forever wishing that she looked a certain way.And so she excitedly begins to research plastic surgery procedures on the Internet. Many aspects of her person
    >

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lin

    Home Business - Three Steps To Regain Focus On Your Home Business Goals
    What should you do when you know you have lost focus on your home business goals? Here are three tips to help you get back on track.Step One: stay calm.It would be unproductive to allow yourself to sit and worry about the fact that you can't concentrate, can't seem to finish simple tasks and seem to be getting nowhere. Worrying about your loss of focus can lead you into a state of paralysis because you will feel that your home business and everything around you is beyond your control.It is upsetting when you experience an inability to maintain focu because it makes you feel so helpless. Keep yourself calm by doing a few of your favourite relaxation exercises.Step Two: identify the underlying problem.Identifying the under
    Many of you may be using cPanel hosting software for your website, and may already have hotlink protection configured from within that. However, if you are finding that the set-up is limited, or indeed if you don’t run cPanel or other software which will do it for you automatically, this article is for you. I intend to talk about how to enable hotlink protection through the use of a .htaccess file, and in particular the special tricks you can perform with it.

    A brief introduction first. The file is not named htaccess, instead the file extension IS .htaccess. So in order to create the file you must create a blank text file, lets say new.txt, and simply rename it .htaccess. As long as your server is running apache (which most are) this neat little file will allow you to set up custom error pages, block certain IP addresses and sites, put 301 redirects in place and, most importantly, stop hotlinking.

    Hot linking is often used as a curse in web developer circles. Also known as bandwidth theft, it means linking directly to files and images on somebody else’s server. The victim of hotlinking loses the bandwidth that the files take up, possible visitors to their site that now no longer need to visit to get the resources that they need, and in turn loses money. Most commonly images are hotlinked, to be shown in blog posts, on forums and on unscrupulous webmaster’s own pages.

    The best way to stop this, in my experience, is to use the redirects present in the .htaccess file. Take a look at this code extract below:

     RewriteEngine on
     RewriteCond %{HTTP_REFERER} .
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site1\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site2\. [NC]
     RewriteCond %{HTTP_REFERER} !google\. [NC]
     RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
     RewriteCond %{REQUEST_URI} !^/stophotlink\.gif$
     RewriteRule \.(gif|jpg|png)$ /stophotlink.gif [NC,L]
     
    Now, lets go through this in order. The first line indicates to the server that you wish to rewrite certain file paths. As the htaccess is consulted before any request that the server processes, there is no way around this rewriting.

    The line:

    RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lin

    Entrepreneurs Don't Have Average Credit Scores
    Fair Isaac, the company that develops the formula to determine credit scores looks at the average statistics of consumers and factors that into your score, called a (FICO). According to Fair Isaac the average consumer will have:· One inquiry on their personal credit report in a given year · 54% of credit holders carry a balance of less then $5,000 on all debts other then a mortgage · Have access to $12,190 on all credit cards combined“Now are entrepreneurs, like you, the typical consumer?” I asked one of my clients (J.G.). “No.”, said J.G.. “You will see that as an entrepreneur, we have several more credit needs then the average consumer. So when the personal credit bureaus compare us to the average consumer, our credit consumption
    to create the file you must create a blank text file, lets say new.txt, and simply rename it .htaccess. As long as your server is running apache (which most are) this neat little file will allow you to set up custom error pages, block certain IP addresses and sites, put 301 redirects in place and, most importantly, stop hotlinking.

    Hot linking is often used as a curse in web developer circles. Also known as bandwidth theft, it means linking directly to files and images on somebody else’s server. The victim of hotlinking loses the bandwidth that the files take up, possible visitors to their site that now no longer need to visit to get the resources that they need, and in turn loses money. Most commonly images are hotlinked, to be shown in blog posts, on forums and on unscrupulous webmaster’s own pages.

    The best way to stop this, in my experience, is to use the redirects present in the .htaccess file. Take a look at this code extract below:

     RewriteEngine on
     RewriteCond %{HTTP_REFERER} .
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site1\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site2\. [NC]
     RewriteCond %{HTTP_REFERER} !google\. [NC]
     RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
     RewriteCond %{REQUEST_URI} !^/stophotlink\.gif$
     RewriteRule \.(gif|jpg|png)$ /stophotlink.gif [NC,L]
     
    Now, lets go through this in order. The first line indicates to the server that you wish to rewrite certain file paths. As the htaccess is consulted before any request that the server processes, there is no way around this rewriting.

    The line:

    RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lin

    Communicating Our Attitude
    The goal of successful marketing is to create long lasting relationships with your prospects by marketing your business with passion. When you’re not excited about what you’re doing, no one else will be either. Our passion for what we do in business is communicated through our attitude. Our attitude comes shining through in a variety of ways. How can you create an attitude that paves the way to success for you and your business?1. You are what you speak. The words we use say everything about who we are and what we are about. Our spoken words are probably one of the most obvious ways we communicate our attitude to others. Think about what you say before you speak. Will it serve to build connection, community or relationship with others? If not
    ble visitors to their site that now no longer need to visit to get the resources that they need, and in turn loses money. Most commonly images are hotlinked, to be shown in blog posts, on forums and on unscrupulous webmaster’s own pages.

    The best way to stop this, in my experience, is to use the redirects present in the .htaccess file. Take a look at this code extract below:

     RewriteEngine on
     RewriteCond %{HTTP_REFERER} .
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site1\. [NC]
     RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?site2\. [NC]
     RewriteCond %{HTTP_REFERER} !google\. [NC]
     RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
     RewriteCond %{REQUEST_URI} !^/stophotlink\.gif$
     RewriteRule \.(gif|jpg|png)$ /stophotlink.gif [NC,L]
     
    Now, lets go through this in order. The first line indicates to the server that you wish to rewrite certain file paths. As the htaccess is consulted before any request that the server processes, there is no way around this rewriting.

    The line:

    RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lin

    Your Own List To Build, Or Not To Build?
    To build, or not to build. That is the question. With a number of Websites that outcomes the number of people leaving on our planet, and only 1/6 of them connected to the internet, you can be sure that you will need more than just publish your Website to make in be seen by the audience.You can use any form of advertising, and get good traffic; but once your visitor is gone, if you didn't collect his email address, the chances for this visitor to come again to your Website are minimal. Then, not to grab your visitors contact email will be an inefficient, missed task.Web traffic implies a cold relation. People go to your site and navigate into it: your site is the exhibit of your product and service. You can have a very appealing site and offer a
    %{HTTP_REFERER} !^http://([^.]+\.)?site2\. [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteCond %{REQUEST_URI} !^/stophotlink\.gif$ RewriteRule \.(gif|jpg|png)$ /stophotlink.gif [NC,L] Now, lets go through this in order. The first line indicates to the server that you wish to rewrite certain file paths. As the htaccess is consulted before any request that the server processes, there is no way around this rewriting.

    The line:

    RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?shock-therapy\. [NC]

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lin

    Giving Gifts That Are As Unique As You Are!
    As we approach this holiday season, let’s stop and reflect upon what the holidays really mean. For many, it means getting together with family. For others, it means holiday parties and lots of food. For some, it might mean a vacation in a warm climate as a get-away from work and/or school. And yet for others, it might mean just another day on the calendar. Regardless of how you might view the holidays, I think it would be fair to say that for the majority, the holidays and gift-giving go hand in hand.The gift industry is huge. Just look at the rise of gift cards, just one facet of the gift industry. The National Retail Federation (NRF) estimates that consumers will spend a total of $24.81 billion on Gift Cards this holiday season alone. That’s about
    >

    Is important as it allows any of the images (in this case) to be viewed from within the site. Obviously you don’t want to set it up so you can’t see your own images! The !^ in this case acts as a ‘NOT’, meaning that any site prefaced with that will be allowed to link directly to any images. The ([^.]+\.)? in place of the typical www acts as a wild card, so that any sub domain can use this. This helps with canonical issues, as well as if you wish to allow a certain forum (which may use forum.site1.com, for example) access to the files. Of course, the other HTTP_REFERER lines show which sites other than your own are allowed direct links – in this case site1 and site2.

    Ok then, time for the first of the more advanced features. These two lines of code here:

     RewriteCond %{HTTP_REFERER} !google\. [NC]
     RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
     
    These will allow Google image search direct access to your images. After all, it’ll annoy people who are looking for images if all they get is either an error or a custom image (I’ll get onto that soon). Of course, some people don’t like the idea of Google allowing people to access their copyright images, in which case these two lines should not be included.

    Now we come to the most essential part of it all. The next two lines specify which file type you want blocked and can even be used to configure a custom image to be shown (with advantages which will become apparent):

     RewriteCond %{REQUEST_URI} !^/stophotlink\.gif$
     RewriteRule \.(gif|jpg|png)$ /stophotlink.gif [NC,L]
     
    The last line disables direct links to gif, jpg and png file types. Any other types that you wish to block can be added, however it is dependent upon whether you wish to redirect the hotlinkers or not. If you look at the second line again you will see the phrase ‘$ /stophotlink.gif’. Now the great thing about this is that it actually replaces the image your server will show with a custom one! So you may be want to post a rude picture, or maybe a brief injunction to stop nicking your bandwidth. Either way the image will be shown on the site linking to you, rather than the originally intended image.

    Even better, as the original site owner often still has the original image in their cache, they don’t even realise there’s been a switch. So while visitors to his site look upon your free advertising (or otherwise) he is blissfully un-aware that anything is wrong. Until he refreshes the page at least.

    The first line of that example is essential, by the way. It specifically tells the server to exclude the image ‘stophotlink.gif’ from the hotlink protection. You wouldn’t want a nasty infinite loop, now, would you?

    This same technique can be used to refer people to a specific HTML page as well. Say in the case of files:

    RewriteRule \.(avi|mpg|zip|exe)$ /forbidden.html [NC,L]

    This w

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.casualarticles.com/article/87337/casualarticles-Advanced-Hotlink-Protection.html">Advanced Hotlink Protection</a>

    BB link (for phorums):
    [url=http://www.casualarticles.com/article/87337/casualarticles-Advanced-Hotlink-Protection.html]Advanced Hotlink Protection[/url]

    Related Articles:

    Find a Job Opportunity Online

    How To Open A Home Based Candy Wrapper Making Business

    Knowledge Management Challenges

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com