Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Inside httpd.conf:

 rewriterule  ^questions/([0-9]+).*  ...

It matches /questions/1674/<textarea>,but not /questions/1674/<textarea><%2Ftextarea>

share|improve this question
Are you rebuilding ServerFault? :-) – Josh Mar 23 '10 at 13:01

If you have an encoded forward slash in the URI, Apache returns an immediete 404. The error log will state:

[info] [client] found %2f (encoded '/') in URI (decoded='/question/1/'), returning 404

To work around this, add to your httpd.conf root or <VirtualHost> section the following directive:

AllowEncodedSlashes On

And then your rewrite will work. Information from the Apache manual:

The AllowEncodedSlashes directive allows URLs which contain encoded path separators (%2F for / and additionally %5C for \ on according systems) to be used. Normally such URLs are refused with a 404 (Not found) error.

For more information, see:

share|improve this answer

Maybe you need the No Escape [NE] flag on the rule? Search for noescape in this page.

share|improve this answer
This flag deals with the output of rewrite,but my problem seems to be the input of the rewrite. – apache Mar 21 '10 at 2:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.