• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Separate folders for full size images and thumbs?

Status
Not open for further replies.

TaintedPix

Chevereto Member
I noticed that the thumbnails and full image sizes are stored in the same folder. Also, within the config.php, it states that the settings below are just for legacy reasons...

Code:
$config['folder_images'] = 'images';
$config['folder_thumbs'] = 'images/thumbs'; // Just for legacy concerns, this is actually not used anymore since 2.1

How can I set it up so that I have separate folders for the full-sized images and another folder for the thumbs. The main point being is that I want to be able to disable hotlinking for the full sized images probably using .htaccess. Well, unless there such disabling of large images is somewhere already built into the code. Is it?

Thanks in advance.
 
And why you need a different folder for that? .htaccess hotlink protection works with regex so you can make pretty complex rules to allow/disallow content.

For instance let's say that you want to disable the direct access to the files but not the thumbs... the code will be like this:
Code:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://demo.chevereto.com [NC]
RewriteCond %{REQUEST_URI} !^(.+)\.th\.(jpg|jpeg|png|gif) [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://demo.chevereto.com/hotlink.gif [NC,R,L]

Notice the regex? !^(.+)\.th\.(jpg|jpeg|png|gif)

Source: http://chevereto.com/community/thre...nking-unless-its-a-thumbnail.1642/#post-14046
 
Thanks again for your help. It worked like a charm with only one minor change... I had to make the hotlink.gif into hotlink.th.gif otherwise .htaccess blocked that image. It works like a charm!
 
Actually that image comes bundled but it is in /content/system/img/ but of course you can make your own ;)

I will mark this as "solved", I'm glad to help you.
 
Status
Not open for further replies.
Back
Top