• 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.

Set your own "not found" image replacement

Rodolfo

⭐ Chevereto Godlike
Chevereto Staff
Administrator
As requested I will apply this feature in 2.4 but since is more like a .htaccess easy-to-do I will tell you how to get it now.

For those who doesn't know what this is about, this will convert any nof found image to something like this:

404.gif


Step by step guide:

1. Go to your Chevereto's root .htaccess file and BEFORE this line:
Code:
RewriteRule ^api$ api.php [L]

Add this code:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule images/.+\.(gif|jpe?g|png|bmp) content/system/img/404.gif [NC,L]

Please notice that images/ is your image directory. You will have to edit that "images/" to match your image directory if you don't use the default one. Also notice the location of the 404.gif image, it can be ANY place of your installation that one is just for demo and it can be a png, jpg, etc...

2. Upload the not found picture to the path that you choose.

3. That's all, to test simply open a image that you know that doesn't exists. Something like http://demo.chevereto.com/images/hey_im_sexy_and_i_know_it.png and when you try to embed that image you will get this:

hey_im_sexy_and_i_know_it.png


Please quote this topic so you will see that I'm calling the file and the system is making the rewrite.

That's all, hope you like it.
 
Thanks to Gunz there are the NGINX rewrite rules for this:
Code:
location /images/ {
root /<path to your website root>/;
autoindex off;
if (-f $request_filename) {
break;
}
rewrite ^/images/(.*) [URL]http://yoursite.com/content/system/img/404.png[/URL] permanent;
}
 
Back
Top