title: How to encode special characters using mod_rewrite & Apache?
body: <p>I would like to have pretty URLs for my tagging system along with all the special characters: <code>+</code>, <code>&amp;</code>, <code>#</code>, <code>%</code>, and <code>=</code>.  Is there a way to do this with mod_rewrite without having to double encode the links?</p>
  <p>I notice that delicious.com and stackoverflow seem to be able to handle singly encoded special characters. What's the magic formula?</p>
  <p>Here's an example of what I want to happen:</p>
  <pre><code>http://www.example.com/tag/c%2b%2b
  </code></pre>
  <p>Would trigger the following RewriteRule:</p>
  <pre><code>RewriteRule ^tag/(.*)   script.php?tag=$1
  </code></pre>
  <p>and the value of tag would be &quot;c++&quot;</p>
  <p>The normal operation of apache/mod_rewrite doesn't work like this, as it seems to turn the plus signs into spaces.  <strong>If I double encode the plus sign to '%252B' then I get the desired result</strong> - however it makes for messy URLS and seems pretty hack to me.</p>