Redirect page from my site

[ad_1]

Hi

i have multiple URL (more than 1k) of my site which i want to redirect to 404, to be unindexed by Google

The indexed links are like this : hxxps://mysite.com/?bkzlriry235916cdefgh , always the same pattern (random chars and numbers).

To get them removed from Google, i think a rewrite rule in apache Vhost or htaccess can do the job to get a 404 or 410 HTTP Code.

Problem is that i can’t match the question mark ‘?’ by regex, even if i escape it. So the rules is wrong and block all my site.

i did something like that and many other tests :

RewriteRule \^/\\?(.\*)$ https://%{HTTP\_HOST}/ \[NC\]

Do you have an advice for me ?

Thanks in advance !

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer