Changing language redirects to minicart

#1
Opencart core: 2.3.0.2
Opencart LiteSpeed Cache: v2.1 ( https://github.com/litespeedtech/ls.../package/lscache-opencart2.3-V2.1.0.ocmod.zip )
Opencart theme: Journal v3.1.4
php: 7.2.x

When I enable LiteSpeed Cache and try to change language in front-end, let's say from Greek to English, I get redirected to minicart!
I have attached three screenshots (might help).

Here is the LiteSpeed Cache's log from Opencart:
2021-08-26 6:09:13 - X-LiteSpeed-Cache-Control:public,max-age=604800
X-LiteSpeed-Tag:7afapage_common_home,7afaC_209,7afaC_313,7afaC_210,7afaC_322,7afaM_34,7afaM_18,7afaM_27,7afaM_14,7afaM_31,7afaM_116,7afaM_113,7afaM_122,7afaM_23,7afaM_128,7afaC_212,7afaC_213,7afaC_97,7afaC_96,7afaC_413,7afaC_169,7afaC_373,7afaC_140,7afaC_216,7afaC_439,7afaC_433,7afaC_437,7afaI_12,7afaC_59,7afaC_274,7afaC_275,7afaC_271,7afaC_318,7afaM_136,7afaC_276,7afaC_311,7afaC_277,7afaC_278,7afaC_279,7afaC_445,7afaC_328,7afaC_316,7afaC_455,7afaC_447,7afaC_323,7afaC_460,7afaC_282,7afaC_291,7afaC_451,7afaC_453,7afaC_284,7afaC_457,7afaC_285,7afaC_286,7afaC_289,7afaC_287,7afaC_288,7afaC_332,7afaC_290,7afaC_292,7afaC_273,7afaC_293,7afaC_294,7afaC_295,7afaC_327,7afaC_458,7afaC_301,7afaC_300,7afaC_456,7afaC_302,7afaC_384,7afaC_377,7afaC_372,7afaC_374,7afaC_352,7afaC_351,7afaC_355,7afaC_354,7afaC_353,7afaC_357,7afaC_359,7afaC_358,7afaC_102,7afaC_339,7afaC_348,7afaC_344,7afaC_343,7afaC_346,7afaC_347,7afaC_349,7afaC_342,7afaC_341,7afaC_345,7afaC_340,7afaC_229,7afaC_386,7afaC_385,7afaC_304,7afaC_303,7afaC_336,7afaC_244,7afaC_270,7afaC_317,7afaC_255,7afaC_310,7afaC_236,7afaC_248,7afaM_137,7afaC_305,7afaC_330,7afaC_314,7afaC_252,7afaC_449,7afaC_329,7afaC_312,7afaC_459,7afaM_108,7afaC_249,7afaC_257,7afaC_307,7afaC_450,7afaM_138,7afaC_452,7afaC_232,7afaC_319,7afaC_253,7afaC_263,7afaC_309,7afaC_239,7afaC_230,7afaC_423,7afaC_256,7afaC_240,7afaC_260,7afaM_47,7afaC_107,7afaC_334,7afaC_335,7afaC_415,7afaC_418,7afaC_420,7afaC_125,7afaC_419,7afaC_121,7afaC_104,7afaC_404,7afaC_421,7afaC_100,7afaC_403,7afaC_105,7afaC_407,7afaC_101,7afaC_405,7afaC_106,7afaC_393,7afaC_394,7afaC_400,7afaC_399,7afaC_398,7afaC_392,7afaC_401,7afaC_362,7afaC_422,7afaC_395,7afaC_397,7afaC_396,7afaC_412,7afaC_414,7afaC_337,7afaI_3,7afaI_4,7afaI_11,7afaI_10,7afaI_6,7afaI_9,7afaM_125,7afaM_104,7afaC_387,7afaC_122,7afaC_214,7afaI_5,7afaI_8,7afa


Can anyone please suggest something?
 

Attachments

AndreyPopov

Well-Known Member
#4
I see Separate View for Mobile and Separate View for Safari are Enabled.


1. are you uncomment corresponding LSCache rewrite rules in your .htaccess?
2. are LSCache rewrite rules placed in .htaccess before others rewrite rules, especially that contain [L] flag

P.S. Separate View for Safari only need if you enable Webp support in Journal3 settings!!!!
 
#5
Andrey hi & thank you for your help!

I have placed the following rules at the very beginning of my .htaccess file:

### LITESPEED_CACHE_START - Do not remove this line
<IfModule LiteSpeed>
CacheLookup on
## Uncomment the following directives if you has a separate mobile view
##RewriteEngine On
##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] RewriteRule .* - [E=Cache-Control:vary=ismobile]
## Uncomment the following directives if you has a separate Safari browser view
##RewriteCond %{HTTP_USER_AGENT} Safari
##RewriteCond %{HTTP_USER_AGENT} !Chrome
##RewriteCond %{HTTP_USER_AGENT} !CriOS
##RewriteRule .* - [E=Cache-Control:vary=isSafari]
##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC]
##RewriteCond %{HTTP_USER_AGENT} Safari
##RewriteCond %{HTTP_USER_AGENT} !Chrome
##RewriteCond %{HTTP_USER_AGENT} !CriOS
##RewriteRule .* - [E=Cache-Control:vary=isMobileSafari]
</IfModule>
### LITESPEED_CACHE_END


still, the same redirect to minicart happens.

Do I need any more rules to add?
 

AndreyPopov

Well-Known Member
#6
## - means that this line comment!!!

uncomment - delete ## symbols at corresponding lines.


after uncomment be sure that you host restarted to use new rules.
 

AndreyPopov

Well-Known Member
#8
But, I do not need the following directives for a separate mobile view nor a separate Safari browser view!
Journal has Separate Views:
- for Desktop devices
- for Mobile devices
that's why you need Enabled LSCache Separate View for Mobile and uncomment

Code:
RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] RewriteRule .* - [E=Cache-Control:vary=ismobile]

if you not make this:
LSCache make cache for the first device that access page.
if first device is mobile device than LSCache always use mobile device view cache even for desktop devices.


if you not set Webp support in Journal then you must set to Disable "Separate view for Safari browser" in GUI


after Apply all changes you also must PurgeALL Cache.
 
Last edited:
#9
Andrey hi,

I have done what you suggested, still the problem exists!

Here are the "good" news. I have a subdomain with the "same" e-Shop (same Opencart installation) and with just enabling LSCache extension everything is working!
I see x-litespeed-cache: hit.
No redirects to minicart when changing language.
It works without placing the rules in the begging of the .htaccess file. Without uncommenting anything. It looks like this:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

### LITESPEED_CACHE_START - Do not remove this line
<IfModule LiteSpeed>
CacheLookup on
## Uncomment the following directives if you has a separate mobile view
##RewriteEngine On
##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] RewriteRule .* - [E=Cache-Control:vary=ismobile]
## Uncomment the following directives if you has a separate Safari browser view
##RewriteCond %{HTTP_USER_AGENT} Safari
##RewriteCond %{HTTP_USER_AGENT} !Chrome
##RewriteCond %{HTTP_USER_AGENT} !CriOS
##RewriteRule .* - [E=Cache-Control:vary=isSafari]
##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC]
##RewriteCond %{HTTP_USER_AGENT} Safari
##RewriteCond %{HTTP_USER_AGENT} !Chrome
##RewriteCond %{HTTP_USER_AGENT} !CriOS
##RewriteRule .* - [E=Cache-Control:vary=isMobileSafari]
</IfModule>
### LITESPEED_CACHE_END



Now, I must find what in the hell is different between these two installations.
 

AndreyPopov

Well-Known Member
#10
Here are the "good" news. I have a subdomain with the "same" e-Shop (same Opencart installation) and with just enabling LSCache extension everything is working!
this is different installation or you use Opencart multistore feature?
because LSCache work only with strore = 0 by default.
 
#11
It is a different installation.
Each installation has only one store.
So far, I haven't found the differences (if any) between these two.
 

AndreyPopov

Well-Known Member
#12
what version of OpenLiteSpeed on your host?
LiteSpeed Web Server (LSWS) or OpenLiteSpeed (OLS)

try set to Disable all options in GUI, especially ESI
PurgeAll Cache
clean cache in browser

and check what's happen.
 
#15
Sorry, I forgot to mention that nothing changed!
The ESI setting had already disabled it from the beginning because it breaks Journal's javascripts.
 
Top