I have te following htacces snippet in the wordpress’s htaccess file:
RewriteBase /wordpress/wp-content/themes/mytheme/
RewriteRule css/style.min.css$ /minify/minify.php?dir=%{REQUEST_URI}&file=style.css [L]
Which redirects the following:
https://something.com/wordpress/wp-content/themes/mytheme/css/style.min.css
to:
https://something.com/minify/minify.php?dir=/wordpress/wp-content/themes/mytheme/css/&file=style.css
How can I get the same effect with add_rewrite_rule
?
Read more here: WordPress rewrite rule in functions.php