Forum Moderators: phranque

Message Too Old, No Replies

If not file.png then redirect to file.jpg

Run just in a big problem replacing pictures

         

jetteroheller

11:09 am on Nov 5, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I worked since 1992 with POVRAY. I just changed to BLENDER.
Now I wont to replace several old pictures on my sites with much better pictures created by BLENDER.
I usual used PNG for the POVRAY pictures, but the new BLENDER generated versions are about 3 times bigger, I consider too big.
So I now store this pictures in JPG.
These pictures are referenced a lot of times on my sites.

So I need something in .htaccess like

If filename.png does not exist then redirect to filename.jpg

jetteroheller

7:25 am on Nov 10, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I used gedit to solve the problem. I replaced about 10 filenames in the folder internet, where all my domains are.

lucy24

4:43 pm on Nov 10, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Whew! If you hadn't found a solution we would have been looking at the dreaded !-f RewriteCond. Though if it's only a question of ten files, a redirect of specific named files would be a better approach anyway.

Funny, I thought I was the last person on the planet to give thought to image filesizes.

jetteroheller

8:32 pm on Nov 10, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I pack all navigation graphics in one png file, compress this png with optipng and pngquant
I have my own CMS with conditional generating JavaScript. So only all the JavaScript for a domain is created by this in only one js file.
Common elements for a page are in the JavaScript and inserted by the JavaScript.
All htm and js are gz compressed.
CSS is small and direct in the page to avoid another file load.
Sequence of html elements is optimized for fast showing the first content.
I have for all this best scores at page speed.

I have old pages monetized by AdSense.
At all new pages, I do not use Cookies, instead a javascript generating much information direct in the log files.
So I avoid the terrible EU law with the opp up “We use cookies, You have to agree”.
As long as there are not hundreds of thousands of visitors, browser info, resolution, languages and other available information are unique enough to track visitors.