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

Viewer Link URL Modification

First of all, you can't achieve that URL right now. Because the filenames currently include always the file extension.
So, it can be something like /YyWnG.jpg.hml

Is that what do you want?
 
But you want the viewer or just the image on that url?
 
Rodolfo said:
But you want the viewer or just the image on that url?

The viewer. Because when clicking on the image, I want it to load another image randomly in the same window, that is stored in the images folder.
 
It can be made but it not SEO friendly. I mean .jpg means image so if i saw a viewver that could make google angry.
 
Ok how can it be made? What file needs to be edited? Also when clicking on the image in viewer, I want it to open another image randomly in the same window, that is stored in the images folder.
 
One question at the time... if you want that http://demo.chevereto.com/images/YyWnG.jpg
Work like http://demo.chevereto.com/YyWnG.jpg you have two alternatives:

A. Use a .htaccess rule (the images will be like a "shortcut")
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^api$ api.php [L]

RewriteRule ^(\w*)\.(jpg|gif|png)$ images/$1\.$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

Options -Indexes

B. Use the root as the folder for image storage (you have to edit config.php) http://chevereto.com/docs#!configuration

If you do the option A you must edit the theme files to map the image codes and links to / instead of /images. If you do the B option you don't have to do this.

As a recommendation, both practices are not good. In Chevereto 3.0 it will be introduced friendly and unique image URLs but is your call.

If you want that the click on the image opens a new page or a popup and also the image, you need a little JS event. Please make a different topic for each question, is more easy to follow up and it's not more expensive ;)
 
Rodolfo said:
One question at the time... if you want that http://demo.chevereto.com/images/YyWnG.jpg
Work like http://demo.chevereto.com/YyWnG.jpg you have two alternatives:

A. Use a .htaccess rule (the images will be like a "shortcut")
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^api$ api.php [L]

RewriteRule ^(\w*)\.(jpg|gif|png)$ images/$1\.$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

Options -Indexes

B. Use the root as the folder for image storage (you have to edit config.php) http://chevereto.com/docs#!configuration

If you do the option A you must edit the theme files to map the image codes and links to / instead of /images. If you do the B option you don't have to do this.

As a recommendation, both practices are not good. In Chevereto 3.0 it will be introduced friendly and unique image URLs but is your call.

If you want that the click on the image opens a new page or a popup and also the image, you need a little JS event. Please make a different topic for each question, is more easy to follow up and it's not more expensive ;)

What if I want the viewer (http://demo.chevereto.com/?v=Ben6m.jpg) to work like http://demo.chevereto.com/?v=Ben6m.jpg.html ?
 
Rodolfo said:
xipr said:

The rule should be:
Code:
RewriteRule ^(\w*)\.(jpg|gif|png)\.html$ images/$1\.$2 [L]

Instead of:
Code:
RewriteRule ^(\w*)\.(jpg|gif|png)$ images/$1\.$2 [L]

Updated the .htaccess file. How to update the theme files? Also what will happen to all the existing images with the following url style http://demo.chevereto.com/?v=Ben6m.jpg - will it automatically be changed to http://demo.chevereto.com/?v=Ben6m.jpg.html ?
 
There is NO WAY of removing .jpg/.gif/.png in the current chevereto release. The only way of doing this is using database (of any kind) that uses the image <NAME> as ID, that will be avaible on 3.0

You can't remove the extension, for instance what happen if you got file1.jpg and file1.png? The only way of doing this without dB is storing the images in the same extension, for instance convert all the gif/bmp/png to jpg and then make the htaccess rule.

xipr said:
I'm not sure how to do (1) and (2). Can you explain how.
(1) You have to make a redirect rule, either a query_string htacces or a php handler redirect

(2) Theme URLs point to ?v= you have to manually change those on the theme and in the peafowl.php javascript


Can I give you an advice? Leave it on the current default config, when 3.0 comes out all the old links will be transformed to 3.0 format, but if you customize now... Well, you will be on your own.
 
After thinking of a way to get what you wanted, I had a nice little idea ;)

Since we can not know the type of image without the extensions, I decided to replace the extension.

So if you want to view the image (rsduf.png) with the following script you can simply type : http://yourwebsite.com/prsduf

Note the p before the rsduf... the p indicate that the image is a png, nice idea no? ;)

Open your .htaccess

find

Code:
RewriteEngine On

add after

Code:
RewriteRule ^[j](.*)$ images/$1.jpg [L]
RewriteRule ^[p](.*)$ images/$1.png [L]
RewriteRule ^[g](.*)$ images/$1.gif [L]
 
Back
Top