L
L
ligisayan2017-08-29 13:07:37
Google
ligisayan, 2017-08-29 13:07:37

How to configure wordpress POST and GET request handler for gclid google adwords labels?

Hello! When setting up Google Adwords, they indicated the site url on wordpress, but the transition turns out to be a broken link, because Google adds its gclid tags to all ads , which come after ? (question mark), and the site engine treats it as a search on the site
How to configure the POST and GET request handler in the URL string so that the CMS (Wordpress) does not treat it as a search on the site?
a247bd7ac0674e6f8347a5c5903b6098.png
I do according to
the guide , i.e. I add instructions to .htaccess

# BEGIN Remove Google Adwords query string 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} "gclid=" [NC]
RewriteRule (.*) /$1? [R=301,L,QSD]
<IfModule mod_rewrite.c>
# END Remove Google Adwords query string

but, I get an internal 500 server error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-08-29
@ligisayan

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (^|&)gclid\=.+($|&)
RewriteRule (.*) /$1? [R=301,L,QSD]

However, I suppose you need to exclude
the following pages from the CNC of the WordPress itself, and therefore embed the negation of the get request into the CNC
RewriteCond %{QUERY_STRING} !(^|&)gclid\=.+($|&)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question