Prestashop 1.7.8 bug fix with frontend images

arnaudbzh

Member
XNullUser
Joined
May 3, 2023
Messages
123
Reaction score
0
Points
16
Location
Lisbon
NullCash
29
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
 

ilsanto64

Active member
XNullUser
Joined
Feb 7, 2019
Messages
1,173
Reaction score
9
Points
38
NullCash
45
Thanks for this update for bug resolving...
 

d-shilko

Well-known member
☆☆ Special ☆☆
☆ Pro ☆
Joined
Jun 10, 2021
Messages
2,596
Reaction score
1,701
Points
113
NullCash
1,328
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
267
Reaction score
27
Points
28
NullCash
115
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
178
Reaction score
1
Points
18
NullCash
1
thank you for this TIP, can this be resolved with some future updates?
 
Top