Home > Back-end >  How to redirect ?xyz to homepage in Wordpress
How to redirect ?xyz to homepage in Wordpress

Time:01-24

I have a website built on Wordpress with a Wordfence plugin and Google has crawled many of the those pages which has "?wordfence_logHuman=1&hid=751DEE19F9CB72995FCC76302FE8C954" in the URL.

So, in my instance it is like that, https://www.example.com/?wordfence_logHuman=1&hid=751DEE19F9CB72995FCC76302FE8C954

Is there a way through .htaccess to redirect all of them to the homepage?

I can stop Google to crawl them through Robots.txt, and I have already done that. But I want some code that I could use for 301 redirection.

Many thanks!

I am expecting a .htaccess code please.

CodePudding user response:

You can use this

RewriteEngine on

RewriteCond %{THE_REQUEST} /\?wordfence_logHuman=1&hid= [NC]
RewriteRule ^ /? [L,R=301]
  • Related