• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

htaccess hotlinking

Gunz

Chevereto Member
As i wrote here http://chevereto.com/community/threads/discussion-porn.2352/#post-14537 there are a lot of china users that uploaded images and i don't want ban them.

So i was thinking to block the hotlink of the images but not for thumbnail. So now i need an htaccess rule that do that and block all the ips of china country.

I'm searching to do this but without success, if someone know how to do it please write on that topic.

Thank you for help.
 
With that all china users can't enter on my site. I want only block Hotlinks, that the problem. I have 5.000.000 hits every days but only 400 users logged on site. So the problem is only hotlinking.

I need disable hotlink only for directly images and not for thumbnail (that consume low bandwith, and users must enter on my site to see the image).

I'm searching now to find a solution but it's not easy like i thought.

Thank you however for the help.
 
For now on cloudflare i blocked all threat "bot net" from china. But i need a better solution about hotlinking.
 
For now on cloudflare i blocked all threat "bot net" from china. But i need a better solution about hotlinking.

Can you give me your directory folder structures ? Been a long time since I installed chevereto, and I know it evolve from the last time I checked.

Is it : images/date/images.png and images/date/thumbs/image.png ?
 
Pretty much found out how :

Code:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?seconddomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !google. [NC]
RewriteCond %{HTTP_REFERER} !search?q=cache [NC]
RewriteCond %{HTTP_REFERER} !msn. [NC]
RewriteCond %{HTTP_REFERER} !yahoo. [NC]
RewriteCond %{REQUEST_URI} !^/path/to/images/
RewriteRule .*.(gif|jpg|jpeg|png)$ http://www.mydomain.com/pages/images/hotlinkingisbad.jpg [R,NC,L]

This will block all hotlinking, we just need to rewrite the last line to ignore .th.ext files

The last line will show another image you which or you can replace it with this :

Code:
RewriteRule .*.(gif|jpg|jpeg|png)$ – [F,L]

it will simply block the page
 
Wait 🙂 With that you will block all hotlink, i need to block only hotlink from chine. 90% of hits are from china forum with porno pictures.
 
Wait 🙂 With that you will block all hotlink, i need to block only hotlink from chine. 90% of hits are from china forum with porno pictures.

I know, like I said, It still need work. But if anybody join the discussion, he will be able to start from where we are, and not from nothing.
 
I think it's better start from here:
Code:
RewriteEngine On
 RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example\.com/ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example1\.com/ [NC]
 RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L]

With that all the website can hotlinking (as i want) exacept example.com and example1.com.
 
To enable always the thumb we must put a thing like that:

Code:
RewriteCond %{QUERY_STRING} !.th. [NC]

But sincerly i don't think is correct as sintax.
 
Back
Top