Prestashop 1.7.8 bug fix with frontend images

arnaudbzh

New member
XNullUser
Joined
May 3, 2023
Messages
28
Reaction score
0
Points
1
Location
Lisbon
NullCash
17
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,022
Reaction score
8
Points
38
NullCash
14
Thanks for this update for bug resolving...
 

d-shilko

Well-known member
Pro
Master
Diamond
Elite
Joined
Jun 10, 2021
Messages
2,499
Reaction score
1,445
Points
113
NullCash
5,892
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
183
Reaction score
26
Points
28
NullCash
182
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
155
Reaction score
1
Points
18
NullCash
5
thank you for this TIP, can this be resolved with some future updates?
 
Top