title: WordPress rewrite rule in functions.php
body: <p>I have te following htacces snippet in the wordpress's htaccess file:</p>
  
  <pre><code>RewriteBase /wordpress/wp-content/themes/mytheme/
  RewriteRule css/style.min.css$ /minify/minify.php?dir=%{REQUEST_URI}&amp;file=style.css [L]
  </code></pre>
  
  <p>Which redirects the following:</p>
  
  <pre><code>https://something.com/wordpress/wp-content/themes/mytheme/css/style.min.css
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>https://something.com/minify/minify.php?dir=/wordpress/wp-content/themes/mytheme/css/&amp;file=style.css
  </code></pre>
  
  <p>How can I get the same effect with <code>add_rewrite_rule</code>?</p>
  
  <hr>
  
  <p><strong>Update 2</strong></p>
  
  <p>So what I want is: my wordpress is in folder <code>wordpress</code>, which is in the root. But I use my wordpress page from <code>https://something.com/main</code>, so I followed the guide on the wordpress page and it works. What I want is, I have assets files in my theme folder like <code>/wordpress/wp-content/themes/mytheme/assets/css/style.css</code>.</p>
  
  <p>I want a php function like:</p>
  
  <pre><code>&lt;img src="&lt;?php echo myRoute("/wordpress/wp-content/themes/mytheme/assets/css/global_stylesheet_file.css", "/home/assets/css/style.css"); ?&gt;" /&gt;
  </code></pre>
  
  <p>which returns to the html like <code>https://something.com/main/assets/css/style.css</code> but creates a htaccess or a route for this to access the original file</p>