• 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.
    • We recommend purchasing a Chevereto license to participate in this community.
    • Purchase a Community Subscription to get even faster ticket response times.

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