• 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

Redirect ID-links to image viewer

Status
Not open for further replies.

Lastopp

Chevereto Member
This is something I suggested a few years back. I would like direct image links like http://domain.com/images/<id>.png to redirect to http://domain.com/image/<id>.

For people using the file naming method ID I think this could easily be done using htaccess.

Live example: http://i48.tinypic.com/nyv0qx.jpg

As you can see by going directly to that link you are redirected to the website with ads and more. And using that link does now cause any issues if you decide to put it inside img tags or use it as avatar on a forum.

I think this is the perfect way to make money of your Chevereto site if you have ads on the image viewer page, also a great way to make a bigger community.
 
Thanks,

But how would I do this if I use external storage?

Domain: https://domain.com/image/<id>.ext
Storage domain: http(s)://i.domain.com/<id>.ext
Code:
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{HTTP_REFERER} ^$
RewriteCond %{HTTP_REFERER} !^http://127.0.0.1/$
RewriteRule images\/.+\/(\w+)(\.md|th){0,1}\.(gif|jpe?g|png|bmp) http://127.0.0.1/image/$1 [NC,L,R=301]
 
External storage needs PHP to do that, I won't recommend doing that using the script layer, it should be achieved only at server layer.
 
Status
Not open for further replies.
Back
Top