title: Wordpress add_rewrite_rule not working
body: <p>I have the page <code>my-page</code>, which has page id <code>38</code> .  </p>
  
  <p>I want to turn </p>
  
  <p><code>http://www.example.com/my-page?q=page-title</code></p>
  
  <p>to</p>
  
  <p><code>http://www.example.com/my-page/page-title</code></p>
  
  <p>I've tried adding this rewrite rule to functions.php.  I keep getting page not found.</p>
  
  <pre><code>function custom_rewrite_tag() {
    add_rewrite_tag('%my-page%', '([^&amp;]+)');
  }
  add_action('init', 'custom_rewrite_tag', 10, 0);
  
  
  function custom_rewrite_rule() {
    add_rewrite_rule('^my-page/([^/]*)/?','index.php?page_id=38&amp;q=$matches[1]','top');
  }
  add_action('init', 'custom_rewrite_rule', 10, 0);
  </code></pre>
  
  <p>How do i solve?</p>