To redirect a category on your WordPress platform to a page on your website, you can add the code you provided to your web.config file. However, you may want to make a few changes to the code to make it work properly.
First, the match element in the code is looking for a URL that ends with /category/name-of-category/. However, the URLs for categories on WordPress typically include the category slug, not the category name, in the URL. For example, if your category has the slug “test-category”, the URL for that category would be https://www.name-of-site.co.uk/category/test-category/. So, you may want to change the match element in the code to look for the URL of the category using its slug instead of its name.
Second, the conditions element in the code is checking whether the requested URL is a file or directory. However, since you are redirecting a URL on your WordPress platform, it is unlikely that the requested URL would be a file or directory on the server. In this case, you may want to remove the conditions element from the code or modify it to check for a different condition.
Third, the action element in the code uses the Redirect type, which will send a 302 redirect to the browser. This type of redirect is temporary and may not be suitable for all situations. If you want to redirect users permanently, you may want to use the RedirectPermanent type instead.
Below is the example I a referring to:
<rule name=”test” stopProcessing=”true”>
<match url=”^/category/test-category/$” />
<action type=”RedirectPermanent” url=”https://www.name-of-website.co.uk/particular-page.asp” />
</rule>
For example, you will need to replace “test-category” with the actual slug of the category you want to redirect, and you will need to replace “https://www.name-of-website.co.uk/particular-page.asp” with the actual URL of the page you want to redirect to.