I need help with redirecting query string ?Action=1&k and ?media= to homepage

[ad_1]

Hi guys! I am new to this and I need help to redirect the following URLs to homepage:

* [https://www.theholisticsanctuary.com/theholisticsanctuary.php?Action=1&k=addiction-rehab-michigan&PageID=288245])
* [https://www.theholisticsanctuary.com/?media=1655378697/article/can-artificial-intelligence-provide-a-human-touch])

I tried to redirect in rank math but no luck and I was wondering why. Also is it possible to do it in htaccess? if yes is this the correct code?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^Action=
RewriteRule ^(.*)$ [R=301,L] </IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^media=
RewriteRule ^(.*)$ [R=301,L] </IfModule>

[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