Current link in browser: http://demo.chevereto.com/?v=YyWnG.jpg
I want: http://demo.chevereto.com/YyWnG
Where do I go to edit?
I want: http://demo.chevereto.com/YyWnG
Where do I go to edit?
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:
Rodolfo said: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?
Rodolfo said:But you want the viewer or just the image on that url?
<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
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
xipr said:What if I want the viewer (http://demo.chevereto.com/?v=Ben6m.jpg) to work like http://demo.chevereto.com/?v=Ben6m.jpg.html ?
RewriteRule ^(\w*)\.(jpg|gif|png)\.html$ images/$1\.$2 [L]
RewriteRule ^(\w*)\.(jpg|gif|png)$ images/$1\.$2 [L]
Rodolfo said:xipr said:What if I want the viewer (http://demo.chevereto.com/?v=Ben6m.jpg) to work like http://demo.chevereto.com/?v=Ben6m.jpg.html ?
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]
Rodolfo said:You have to:
(1) Make a rule for the legay URLs to redirect to the new URL
(2) Manually change the theme and JS ?v= variables. This was asked before in this topic: http://chevereto.com/forums/topic1034-list-of-links-with-viewer-link.html
Yeah. Is quite annoying.
(1) You have to make a redirect rule, either a query_string htacces or a php handler redirectxipr said:I'm not sure how to do (1) and (2). Can you explain how.
RewriteEngine On
RewriteRule ^[j](.*)$ images/$1.jpg [L]
RewriteRule ^[p](.*)$ images/$1.png [L]
RewriteRule ^[g](.*)$ images/$1.gif [L]