RedirectMatch How To?

I have a WordPress multisite using different domains. I need to redirect the URL for the Tags archive page to a customized search query page in two domains.

The issue I am having is that the trigger for the RedirectMatch for each domain is THE SAME, but the resulting URL structure is DIFFERENT. The first rule in the .htaccess file is processing the trigger for both domains, resulting in an error page on the second domain.

Can I ensure that each rule is only processed for the correct domain, even if the trigger string is the same?

Here’s the code I have there now:

RewriteCond %{HTTP_HOST} ^educators.example.com
RedirectMatch “^/tag/(.*)/” “/educational-resources/?_keywords=$1”
RewriteCond %{HTTP_HOST} ^students.example.com
RedirectMatch “^/tag/(.*)/” “/subject-resources/?_keywords=$1”

TIA

 

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