The new parameter FB adds to external links (fbclid)

左心房为你撑大大i 提交于 2021-01-29 09:53:10

问题


As indicated in a similar recent question, in order to have my WordPress blog remove automatically the parameter fbclid=xxxxxxxxx added by FB to all the links pointing to my blog, I inserted the following code to my .htaccess file, in the root of my domain:

RewriteEngine On 
RewriteBase /
RewriteCond %{QUERY_STRING} "fbclid=" [NC]
RewriteRule (.*) /$1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

The result is that who clicks the link on FB goes to the HOMEPAGE of the blog and NOT to the actual page the linked article is, as desired.

How to resolve this?

Update: I found the solution. I added the following to my htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)&?fbclid=(.*)$ [NC]
RewriteRule ^/?(.*)$ /$1?%1 [R=301,L]
</IfModule>

来源:https://stackoverflow.com/questions/52914875/the-new-parameter-fb-adds-to-external-links-fbclid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!