title: Node.js on OpenShift: Apache returns 404 for URLs with percent-encoded '/' characters
body: <p>I have a very simple Node.js blog system running on OpenShift. When it reads metadata for a blog entry, it saves the title after passing it through <code>encodeURIComponent</code>. That percent-encoded string is then used as the post "key" in the URL. </p>
  
  <p>For example: </p>
  
  <ul>
  <li>I write a blog post, titled "post/with/slashes"</li>
  <li>My blogging system reads the title from the metadata, and saves the blog post udner "post%2Fwith%2Fslahes"</li>
  <li>My loving readers go to <code>my-blog.io/post/post%2Fwith%2Fslahes</code> in their web browsers</li>
  </ul>
  
  <p>I'm using Express, and first of all I noticed that Express decodes the URL string before passing to my app (that is, my code finds the string <code>"post/with/slashes"</code> in the request parameters). So I pass it through encodeURIComponent again before looking up the post. I don't <em>think</em> that's relevant, but I've mentioned it just in case.</p>
  
  <p><strong>My problem</strong>: When I run a local instance (this is "standalone" Node.js, no Apache going on), this works fine. Express passes me <code>"post/with/slashes"</code>, I pass that string through <code>encodeURIComponent</code> and I look up the post. But when I deploy to OpenShift, the request does not reach my app at all. I am served OpenShift's default 404 page, which says "The requested URL /post/post/with/slashes was not found on this server."</p>
  
  <p><strong>In summary</strong>: it looks like Apache is decoding the percent-encoded URL <em>before</em> passing it to Node.js. Since there are now slashes in the URL, Express doesn't know how to route the request to my app. Is this expected (and if so why)? If not, why might it be happening and what could I do about it? </p>