paman Posted September 25, 2020 Share Posted September 25, 2020 Good morning everyone It's a very strange problem on a prestashop installation, made some years ago by using 1.6.1.4 version. That's what happens: When the 10 millionth product image is entered, the system does not display it anymore while all the other images with a lower ID keep being displayed with no problem If I disable the URL REWRITE, all the photos are correctly displayed I already made sure that in .htaccess there's the picture display with ID greater than 7 numbers, and it's present. # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] As if prestashop didn't take into consideration this instruction Any tips? Thanks you all - sorry my english - Link to comment Share on other sites More sharing options...
joseantgv Posted September 25, 2020 Share Posted September 25, 2020 You can report it here as a bug: https://github.com/PrestaShop/PrestaShop/issues/new?template=1_bug_report.md Link to comment Share on other sites More sharing options...
paman Posted September 25, 2020 Author Share Posted September 25, 2020 (edited) I also posted it on GitHub view topic: https://github.com/PrestaShop/PrestaShop/issues/21160#event-3807293272 and dedicated repository for 1.6 https://github.com/PrestaShop/PrestaShop-1.6/issues/12 I'm checking if this bug is also present on 1.7 thanks Edited September 25, 2020 by paman (see edit history) Link to comment Share on other sites More sharing options...
ruisonika Posted May 13, 2022 Share Posted May 13, 2022 Sorry i'm having the same problem does anybody find solution? to share, please... Link to comment Share on other sites More sharing options...
Prestachamps Posted May 15, 2022 Share Posted May 15, 2022 Hi, Apache can't do more than 9 captures groups in .htaccess rules, so $10 is interpreted as $1 and a zero in the last line of image redirects. One workaround for the 8 digit image URL's is to add these rules to .htaccess: RewriteRule ^0([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/0/$1/$2/$3/$4/$5/$6/$7/0$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^1([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/1/$1/$2/$3/$4/$5/$6/$7/1$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^2([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/2/$1/$2/$3/$4/$5/$6/$7/2$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^3([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/3/$1/$2/$3/$4/$5/$6/$7/3$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^4([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/4/$1/$2/$3/$4/$5/$6/$7/4$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^5([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/5/$1/$2/$3/$4/$5/$6/$7/5$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^6([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/6/$1/$2/$3/$4/$5/$6/$7/6$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^7([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/7/$1/$2/$3/$4/$5/$6/$7/7$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^8([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/8/$1/$2/$3/$4/$5/$6/$7/8$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^9([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/9/$1/$2/$3/$4/$5/$6/$7/9$1$2$3$4$5$6$7$8$9.jpg [L] Kind regards, Leo. Link to comment Share on other sites More sharing options...
ruisonika Posted May 16, 2022 Share Posted May 16, 2022 21 hours ago, Prestachamps said: Hi, Apache can't do more than 9 captures groups in .htaccess rules, so $10 is interpreted as $1 and a zero in the last line of image redirects. One workaround for the 8 digit image URL's is to add these rules to .htaccess: RewriteRule ^0([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/0/$1/$2/$3/$4/$5/$6/$7/0$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^1([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/1/$1/$2/$3/$4/$5/$6/$7/1$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^2([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/2/$1/$2/$3/$4/$5/$6/$7/2$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^3([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/3/$1/$2/$3/$4/$5/$6/$7/3$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^4([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/4/$1/$2/$3/$4/$5/$6/$7/4$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^5([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/5/$1/$2/$3/$4/$5/$6/$7/5$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^6([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/6/$1/$2/$3/$4/$5/$6/$7/6$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^7([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/7/$1/$2/$3/$4/$5/$6/$7/7$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^8([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/8/$1/$2/$3/$4/$5/$6/$7/8$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^9([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/9/$1/$2/$3/$4/$5/$6/$7/9$1$2$3$4$5$6$7$8$9.jpg [L] Kind regards, Leo. But when you delete cache will be generated new htaccess file, and you will loose this modification (my 2 cents). My workaround was this: presta admin area > preferences > SEO and URL (like this) Then if url mod_rewrite is on make it not and and after make it true again (to generate new htaccess file). And in classes/tools.php ad this code FOR ME IT WORKS NICE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now