Skip to content

Instantly share code, notes, and snippets.

@tedliou
Forked from lynt-smitka/fbclid.htaccess
Created July 6, 2019 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedliou/c1b460549adf46d67031b5e1aa1f3f08 to your computer and use it in GitHub Desktop.
Save tedliou/c1b460549adf46d67031b5e1aa1f3f08 to your computer and use it in GitHub Desktop.
Remove fbclid argument from the URL in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*?)(&?fbclid=[a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ /$1?%1 [L,NE,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment