htaccess 301 Redirect not working for WordPress site

In general it is much better to handle redirect on the PHP side. (assuming is is implemented by semi competent developer) It is more flexible and uses less overhead.

Specifically to the question, the set of wordpress rules will handle all URLs, therefor your rule is too late and you should move it to be before the wordpress rules.

error code: 523