Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:cache:common:seperate-mobile-versions [2016/11/15 20:49] Jackson Zhang |
litespeed_wiki:cache:common:seperate-mobile-versions [2017/04/27 21:10] Jackson Zhang |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Handling Websites With Separate Mobile Versions ====== | ====== Handling Websites With Separate Mobile Versions ====== | ||
+ | |||
+ | **UPDATE:** As of LSCWP version 1.0.4, there is a configuration option that will add this rule automatically. Please see the [[litespeed_wiki:cache:lscwp:configuration#enable_separate_mobile_view|configurations wiki]] for additional details. | ||
Caching may not work properly with websites that have separate Mobile versions using a different skin than the main site. | Caching may not work properly with websites that have separate Mobile versions using a different skin than the main site. | ||
- | In such cases, you can tell LSCache to cache the website's Mobile version differently than the main version so they are not mixed up. Do this by adding the following to the .htaccess file (this is an example only and you may have your own rules): | + | In such cases, you can tell LSCache to cache the website's Mobile version differently than the main version so they are not mixed up. Do this by adding the following to the .htaccess file (these are just some examples only and you may have your own rules): |
+ | |||
+ | <code> | ||
+ | RewriteCond %{HTTP_USER_AGENT} "android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino" [NC] | ||
+ | RewriteRule .* - [E=Cache-Control:vary=ismobile] | ||
+ | </code> | ||
+ | |||
+ | or | ||
<code> | <code> | ||
- | RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR] | + | 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] | RewriteRule .* - [E=Cache-Control:vary=ismobile] | ||
</code> | </code> |