• 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 error 2.0.16->2.3

Status
Not open for further replies.

Wyrmex

Chevereto Member
I've updated 2.0.16 on 2.3.
Redirect doesn't work for old images and thumbnails.
My .htaccess is

Code:
ServerSignature Off
Options -Indexes -MultiViews
 
Options +FollowSymLinks
RewriteEngine On
 
# If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
#RewriteBase /chevereto
 
RewriteRule ^api$ api.php [L]
RewriteRule ^images/(\w*\.)(jpg|png|gif)$ images/old/$1$2 [L] #legacy images
RewriteRule ^images/thumbs/(\w*\.)(jpg|png|gif)$ images/old/$1th.$2 [L] #legacy thumbs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
 
ErrorDocument 400 default
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

RewriteBase /
didn't helped.
 
I notice that your current hosting doesn't parse either the options or the rewrite. I've use this rules and I manage to avoid the 500 error:
Code:
#ServerSignature Off
#Options -Indexes -MultiViews
 
#Options +FollowSymLinks
RewriteEngine On
 
# If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
RewriteBase /
 
RewriteRule ^api$ api.php [L]
RewriteRule ^images/(\w*\.)(jpg|png|gif)$ images/old/$1$2 [L] #legacy images
RewriteRule ^images/thumbs/(\w*\.)(jpg|png|gif)$ images/old/$1th.$2 [L] #legacy thumbs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
 
ErrorDocument 400 default
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

But mod rewrite isn't there, just as a example: http://img.donetsk-x.com/api doesn't do anything. This means that mod rewrite is not present on that setup.
 
Doing this: http://img.donetsk-x.com/test with this:
Code:
RewriteRule ^images/test$ images/old/Z08P.jpg [L]

Works, so the only conclusion that I get from this is that the regex engine is not working properly in your host. I've tweak the regex to this (notice the change of the groups):
Code:
RewriteRule ^images/([a-zA-Z0-9]+\.)(jpg|png|gif)$ images/old/$1$2 [L] #legacy images
RewriteRule ^images/([a-zA-Z0-9]+\.)(jpg|png|gif)$ images/old/$1th.$2 [L] #legacy thumbs

And it works... So the problem was that your server doesn't handle all the regex operarators and the \w which is a shorthand of [a-zA-Z0-9] isn't being interpreted. Don't worry, with the rules I've give you you should be OK.
 
Status
Not open for further replies.
Back
Top