Right hook to redirect frontend visitors while respecting rest api plugins to run first?
The correct solution is to add the redirect to index.php in your theme – this will ensure only frontend, non-api based requests are handled. Sniffing wp-json in the request is dodgy at best, and will all out break if another plugin overrides the endpoint (which you can do, it’s pluggable). <?php wp_redirect( ‘http://example.com/’, 301 ); … Read more