• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Mod Rewrite And Special Characters

I'm running into a problem with urls passed through modrewrite where encoded special charcters such as & (encoded as %26). When it goes through the rewrite module for some reason %26 is converted back to a & and the string is split into two varaibles.

Is there a way to force modrewrite to keep the string alone?
1 Solution
The decoding happens before mod_rewrite is involved. You might double-encode the & into %25%26
The & is not escaped again in the substitution, because it is a valid char in the URL.

An other way would be a self-written RewriteMap (prg:) or applying a patch from http://issues.apache.org/bugzilla/show_bug.cgi?id=32328 which defines a RewriteMap internal function (int:)

ShroderAuthor Commented:
ok. Thank you. :)

I think I may just seperate the 'page title' from the actual file name, so I don't run into this problem anymore. The way the urls are right now probably make them SEO incompatible anyway.

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now