Save Internet traffic to the correct file. Htaccess

(1 ratings Rating: 5 out of 5)
Загрузка ... Loading ...

Sooner or later, all the owners of Internet resources are faced with the problem of increasing traffic consumption.

Consume it not only all the visitors, but the search engine spiders. All files that are on your website, swing over and over again. Increased consumption of traffic to your site negatively affects the speed of his work.

Save Internet traffic to the correct file. Htaccess

With the increasing popularity of your website, more files will swing by your visitors, but it is not necessary to pay attention, this is what you wanted.

However, on the other hand gives rise to an increase in popularity of copying your articles. Third-party webmasters often copy code to your page, even without understanding the details.

In other words, all files uploaded to your hosting will be uploaded to other resources, thereby increasing your bandwidth consumption.

It would seem that the only solution to the problem may be more expensive data plan with lots of traffic. But it is impossible not to agree with the fact that these costs are absolutely unfounded.

It's a shame when someone is profiting from your labors. This creates a sense of revenge and retribution. Why give your traffic unscrupulous people?

Is there an easier way out - the upload using. Htaccess

Suffice it to add the following lines:

  # Block loading of images
 RewriteEngine on
 RewriteCond% {HTTP_REFERER}! ^ $
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Vash_sayt.ru (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Yandex. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Google. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Yahoo. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Mail. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Bing. (. *) [NC]
 RewriteRule (. *)? \. (Jpg | jpeg | png | gif | css | js | zip) $ - [NC, F, L] 

Code will operate on the following principle: the files with a specific extension will not load on the resource is different from yours or search engine . We only allow access to search engines, as many visitors to the site with a "search for pictures."

And here is the long-awaited revenge! I modified the code so that instead of my boot logo image of my site (but you can customize to appear any other picture, including defamatory nerodivogo webmaster)

  RewriteEngine on
 RewriteCond% {HTTP_REFERER}! ^ $
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Vash_sayt.ru (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Yandex. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Google. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Yahoo. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Mail. (. *) [NC]
 RewriteCond% {HTTP_REFERER}! ^ Http (s)? :/ / (Www \.)? (. *)? Bing. (. *) [NC]
 RewriteRule (. *)? \. (Jpg | jpeg | png | gif) $ banner.gif 

In this simple way I have saved up to 50% of Internet traffic.

Last modified: 10/08/2013 at 08:18
Published: Monday, December 13, 2010 at 21:59
Choose the language:

Comments: 4

Average bar: 4.96 out of 5
  1. Vladimir
    December 17, 2010 at 15:01

    And did not think that it is possible in this way to save traffic. But it's true?

    Reply

  2. Vladimir
    December 22, 2010 at 09:49

    Please tell me what kind of hosting to choose?

    Reply

  3. Ai Pi Mani
    December 22, 2010 at 19:03

    I would recommend hosting http://wp-host.com
    If you need a low-cost virtual server, I recommend http://firstvds.ru/

    Reply

  4. Sergei
    July 23, 2011 at 12:17

    https://bill2fast.com/aff.php?aff=1758 - the best hosting.

    Reply

Have something to say? Do not be silent!


Your comment will appear after being moderated.
Spam and off-topic posts are deleted.

To insert php-code, use the tag:
<pre lang="php"> php-code </ pre>


I'm not a spammer!