Prestashop 1.7.8 bug fix with frontend images

arnaudbzh

Member
XNullUser
Joined
May 3, 2023
Messages
48
Reaction score
0
Points
6
Location
Lisbon
NullCash
19
Hello,
in recent updates of Prestashop 1.7.8.8 and 1.7.8.9, you can experience a bug with frontend images.
It blocks all images from the upload folder.
You can add a piece of code in the /.htaccess file to solve the problem.

After this already existing code:
RewriteEngine on
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

Insert this:
RewriteCond %{REQUEST_FILENAME} !.+\.(jpg|jpeg|png|gif|swf|ttf|otf|woff|woff2|eot|svg|webp)$
RewriteRule ^upload/.+$ %{ENV:REWRITEBASE}index.php [QSA,L]

Best regards
 

d-shilko

Well-known member
☆☆ Special ☆☆
☆ Pro ☆
Joined
Jun 10, 2021
Messages
2,542
Reaction score
1,535
Points
113
NullCash
4,194
Hello,
in recent updates of Prestashop 1.7.8.8 and 1.7.8.9, you can experience a bug with frontend images.
It blocks all images from the upload folder.
You can add a piece of code in the /.htaccess file to solve the problem.

After this already existing code:
RewriteEngine on
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

Insert this:
RewriteCond %{REQUEST_FILENAME} !.+\.(jpg|jpeg|png|gif|swf|ttf|otf|woff|woff2|eot|svg|webp)$
RewriteRule ^upload/.+$ %{ENV:REWRITEBASE}index.php [QSA,L]

Best regards
That can't be! I don't recommend to alter .htaccess
 

ciko3650

Active member
XNullUser
Joined
Jul 8, 2021
Messages
207
Reaction score
27
Points
28
NullCash
224
thank you for the info. so far my 1.7.8.8 has no problem
 

shelfbazar

Active member
Elite
XNullUser
Joined
Feb 1, 2022
Messages
37
Reaction score
134
Points
33
NullCash
239
remove
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
RewriteRule ^upload/.+$ %{ENV:REWRITEBASE}index.php [QSA,L]

and paste

RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !.+\.(jpg|jpeg|png|gif|swf|ttf|otf|woff|woff2|eot|svg|webp)$
RewriteRule ^upload/.+$ %{ENV:REWRITEBASE}index.php [QSA,L]
 

racha77

Member
XNullUser
Joined
Jul 25, 2019
Messages
168
Reaction score
1
Points
18
NullCash
5
thank you for this TIP, can this be resolved with some future updates?
 
Top