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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: