PHP 8.4, ZC 2.1.0, Template: ZCA Bootstrap 3.7.5, IH 5.3.5, Ultimate SEO 3.1.2
Is there a way to prevent Ultimate SEO from rewriting the names of images?
PHP 8.4, ZC 2.1.0, Template: ZCA Bootstrap 3.7.5, IH 5.3.5, Ultimate SEO 3.1.2
Is there a way to prevent Ultimate SEO from rewriting the names of images?
Oh christ. That explains why this name breaks:
/bmz_cache/c/cb01-p-109png.image.29x40.png
That's the name generated from Image Handler. Is there a way to exclude the bmz_cache directory? Or is it a hard no? (I've already renamed the source file and directory but still was just curious.)
Would this happen to work?
Code:# Exclude bmz_cache for ImageHandler RewriteCond %{REQUEST_URI} ^/bmz_cache/ [NC] RewriteRule .* - [L]
Running the full .htaccess through an .htaccess tester (https://htaccess.madewithlove.com)
I get the following:
The URL:
https://www.justuptowngames.com/universus-cowboy-bebop-c-2_24/twinkle-murdock-p-847.html
Translates to:
https://www.justuptowngames.com/index.php?main_page=product_info&products_id=847&cPath=2_24&
Which is the normal behavior.
Translating:
https://www.justuptowngames.com/bmz_cache/c/cb01-p-109png.image.88x120.png
Before the change above yields:
https://www.justuptowngames.com/index\.php?main_page=product_info&products_id=109&
(which explains why the <img> tag breaks and clicking on the source in my browser inspect tab takes me to another product page)
But adding the lines above to the area just under the # Start Ultimate (SEO) URL's section (but before the RewriteRules of the same) makes it leave it alone.
Sound like a plan. Would you be willing to create a PR on USU's GitHub? https://github.com/lat9/usu
And done. (Submitted as a PR)
In short, if the REQUEST_URI that starts with /bmz_cache/ (aka the main directory of ImageHandler's cache) is found, regardless of casing (the [NC]), do nothing with it... and STOP searching for more rule matches ([L]).Code:# Exclude /bmz_cache for ImageHandler RewriteCond %{REQUEST_URI} ^/bmz_cache/ [NC] RewriteRule .* - [L]
In short, if the REQUEST_URI that starts with /images/ is found, ZenCart's main primary image directory, regardless of casing (the [NC]), do nothing with it... and STOP searching for more rule matches ([L]) .Code:# Exclude /images directory in general RewriteCond %{REQUEST_URI} ^/images/ [NC] RewriteRule .* - [L]
It gets messy after this point if people put their images in weird, non-standard image directories.
Last edited by retched; 30 Jan 2025 at 12:25 AM.
Bookmarks