I want to add a custom rewrite rule to my .htaccess
file using a function inside functions.php
The rewrite rule I want to add is as follows:
RedirectMatch 301 ^/author/(.+)$ http://name-blog.com/$1
I know there is a WordPress function that adds a rewrite rule to the .htaccess
:
$wp_rewrite->add_external_rule( 'mobile/([^/]+)$', 'mobile/index.php?action=$1' );
So, how can I use that to add my rewrite rule to .htaccess
?