title: Regular Expression for rewrite rule
body: <p>I'm trying to integrate an open source forum in to my WordPress installation, I can figure out the next steps if I can just get a rewrite rule to work, I have the following so far:</p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^forum/qa\-theme/(.*) forum-embed/qa-theme/$1 [QSA,L]
  RewriteRule ^forum/qa\-content/(.*) forum-embed/qa-content/$1 [QSA,L]
  RewriteRule ^forum/([\w]+)$ forum/?url=$1 [QSA,L]
  &lt;/IfModule&gt;
  </code></pre>
  <p>The first two rules work, but the last one, I've tried all sorts of changes to this regular expression - I want to take <em>whatever</em> comes after <code>forum/</code> and to put it in to a query string as the <code>url</code> parameter.  I'm sure I'm tip-toeing around the expression - what am I missing?</p>
  <p>Thanks in advance!</p>
  <p><strong>EDIT</strong></p>
  <blockquote>
  <p>It's also not clear how you are avoiding conflicts with the WordPress front-controller? Presumably you are placing these directives at the top of the .htaccess file, before the # BEGIN WordPress section? However, it may be simpler to create another .htaccess file inside the /forum subdirectory instead and this will (by default) override the WordPress directives.</p>
  </blockquote>
  <p>A sound point, yes I was putting it above the # BEGIN WordPress, but I will make a .htaccess in the forum directory.</p>
  <blockquote>
  <p>You say you've &quot;tried all sorts of changes to this regular expression&quot;, but this regex certainly won't match your first example. The \w shorthand character class excludes slashes and hyphens.</p>
  </blockquote>
  <p>True, this was a bad example to show where I was up to on my question, but I've also tried:</p>
  <ul>
  <li>^forum/(.+)$</li>
  <li>^forum/([a-z-A-Z-0-9-/]+)$</li>
  </ul>
  <blockquote>
  <p>/forum/ is presumably a filesystem directory - this itself can't handle the request, it requires further rewriting to an actual file</p>
  </blockquote>
  <p>I don't understand -- the first two rules work, and I can navigate to all pages, including <code>forum/</code> -- index.php is the default file in the config, why must this rule be an exception?</p>