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

How would I do this.

Shan

💖 Chevereto Fan
Okay, so I own two image hosting websites.

Uplo4d.com and Imagize.me

Both ARE running chevereto 2.1.

In the .htaccess;
Code:
RewriteRule ^images/(\w*\.)(jpg|png|gif)$ /images/old/$1$2 [L] #legacy images

This desermines the location of the old file, and where the new one is located. Now both my websites are on the same host.

Just for example, "upload" is located at 'public_html/randomlocation/uplo4d/' and "Imagize" is located at 'public_html/randomlocation/imagize.me/'.

I wish to merge the two websites. Simply put, I wish ALL of the older images to be redirected to the new location at Imagize.

I know how to redirect the entire website (By simply using 301 redirect), but how would I achieve this using the form above. As I cannot define the root of the domain using this rewrite (if I change the value "/images/old/" above to "./randomlocation/imagize.me/images/old/" the image isn't located.

Anyone got an idea? If the understand that I'm trying to get at.

tldr version

Want to change the RewriteRule above to redirect the location of the older image file (/images) to the new location (/images/old) which is located on a new domain (/public_html/randomlocation/otherdomain/images/old) which is on the same server.

Thanks in advance,
~Shabs
 
do a new rule with rewriteCond http host with the domain you want to move.
 
Rodolfo said:
do a new rule with rewriteCond http host with the domain you want to move.


Unfortunately .htaccess and all the rewrite rules aren't in my strongpoint...I literally have no idea to do them.

Anyone else know what to do, or would be helpful getting the condition started for me.

Thanks again in advance,
~Shabs
 
I get it know... well, you need to do a lot of workaround here and sadly you can't achieve what you want because you can't do a rewriterule to a superior dir to match another path.

In my knowledge, you have 2 alternatives:

A. Use mod_rewrite and loose any image embed
Any image loaded from <img src="http://oldsite.com/image/file.jpg" /> will be blank because mod rewrite will want to make a redirection instead of a rewrite. The images will be served and the will be available but any embed with the old url will be blank.

B. Use php to fetch the images
You can do a PHP script that will use file_get_contents targeting the path (and not the url) of the target file. Then your embed will work but if you have a lot a images your server will collapse. Perhaps if you set up something like cloudflare you can save resources. In this alternative you will be able to do all you want.
 
Back
Top