Google gclid and lscache

AndreyPopov

Well-Known Member
#1
unfortunately lscache accept reference from any Google resource with gclid

https://www.domain.com/page_name&gclid=dhjkhlJLHjlH79798pklKHJHUIHjlh

as different url from https://www.domain.com/page_name

and
- not provide cached page (even page_name already cached)
- create in lscache cached copy for page_name&gclid=dhjkhlJLHjlH79798pklKHJHUIHjlh that never been used again

is right and enough way add to .htaccess rewrite rule:
Code:
RewriteCond %{QUERY_STRING} "gclid=" [NC]
RewriteRule (.*) /$1? [R=301,QSD]
to redirect page_name&gclid=dhjkhlJLHjlH79798pklKHJHUIHjlh to cached page_name without creating unnecessary copy.
 
Last edited:

AndreyPopov

Well-Known Member
#4
but I cannot access to configuration file (shared hosting) and must use Rewrite Rules in .htaccess


Method 2: Rewrite Rules
As an alternative to CacheKeyModify, you can also use rewrite rules. This method supports multiple commands combined, and gives you more flexibility.



Code:
RewriteCond %{QUERY_STRING} "gclid" [NC]
RewriteRule  .* - [E=cache-key-mod:-qs:gclid]
 

serpent_driver

Well-Known Member
#5
As said, set it in .htaccess. The same code is set in cache plugin for WordPress and it works. Nobody said that the documentation was complete and error-free.
 
Top