@@ -524,11 +524,26 @@ RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
524524</section >
525525
526526<section id =" flag_ne" ><title >NE|noescape</title >
527- <p >By default, special characters, such as <code >& </code > and
528- <code >?</code >, for example, will be converted to their hexcode
529- equivalent for rules that result in external redirects.
530- Using the [NE] flag prevents that from happening.
531- </p >
527+ <p >By default, when a <directive module =" mod_rewrite" >RewriteRule</directive >
528+ results in an external redirect, any characters in the output that are
529+ not in the following safe set will be converted to their hexcode
530+ (percent-encoded) equivalents:</p >
531+
532+ <ul >
533+ <li >Alphanumeric characters: <code >A-Z</code >, <code >a-z</code >,
534+ <code >0-9</code ></li >
535+ <li >Special characters: <code >$-_.+!*'(),:;@& =/~</code ></li >
536+ </ul >
537+
538+ <p >For example, <code >#</code > would be converted to <code >%23</code >,
539+ and <code >?</code > to <code >%3F</code >. The <code >%</code > character
540+ is also escaped (to <code >%25</code >), which means that any
541+ percent-encoding already present in the substitution will be
542+ double-encoded.</p >
543+
544+ <p >Using the [NE] flag prevents this escaping, allowing characters
545+ such as <code >#</code > and <code >?</code > to pass through to the
546+ redirect URL unmodified.</p >
532547
533548<highlight language =" config" >
534549RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
0 commit comments