Need help with removing fbclid query string from Facebook


New Member
Hi everyone,

My head is blowing up with this issue. My OpenLiteSpeed server is running with:
- OpenLiteSpeed 1.4.4
- WordPress
- LiteSpeed Cache – WordPress plugin

Everything works great. Pages, posts have been cached as well but if my visitor comes from Facebook, they will get the URL?fbclid=XXX without cache.

Anyone knows some ways to redirect URL?fbclid=XXX to URL? I did in .htaccess but no luck.

Any helps should be appreciated! Thank you.


New Member
Hi @carl, maybe you can give this try

RewriteCond %{QUERY_STRING} fbclid=(.*)
RewriteRule ^.*$ https://%{SERVER_NAME}%1/index.php [QSD,L]
Thanks for reply my question. My htaccess content is:
RewriteCond %{QUERY_STRING} ^fbclid=(.*)
RewriteRule (.*) /$1? [R=301,L]
@Cold-Egg Mine and yours are working good, excepting the sub-page. Finally, I have figured out. I added the code to bottom of .htaccess WordPress file. Need adding to very top htacces file. That's all. :D

@Pong thanks man.