title: How to add rules in .htaccess via WordPress function
body: <p>I am trying to add rules in .htaccess via WordPress function which works perfect but always need to update permalink structure to get it added in .htaccess. How can I refresh / reload .htaccess automatically so that new rules can be added without updating permalink structure.</p>
  
  <pre><code>function add_to_htaccess( $rules ) {
  
  $content = &lt;&lt;&lt;EOD
  \nAddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/x-httpd-php
  AddOutputFilterByType DEFLATE application/x-httpd-fastphp
  AddOutputFilterByType DEFLATE image/svg+xml
  SetOutputFilter DEFLATE\n\n
  EOD;
      return $content . $rules;
  
  }
  add_filter('mod_rewrite_rules', 'add_to_htaccess');
  </code></pre>
  
  <p><em>When I say I have to update permalink structure, I mean I have to go to WP Dashboard > Settings > Permalinks and have to click 'Save'</em></p>