Search code examples
apachemod-rewriteurl-rewritingredhat

Apache 2.4.6 RewriteRule encoding for special chars


I have a problem with a rewrite rule with some special in Apache 2.4.6 in RHEL 7.3. The rewrite i need to execute is the following. "RewriteRule ^/es/47006+P°+Zorrilla+14 http://example.com" The browser response :

Not Found

The requested URL /es/47006+P°+Zorrilla+14 was not found on this server.

Any thoughts anyone.

Thankyou

JVG


Solution

  • It depends:

    1. how path is really encoded by the client
    2. where your rule is located: if it is in a .htaccess (or <Directory> block), your pattern have not to start with ^/en but ^en

    Can you try: RewriteRule ^/?es/47006+P\xC3\x83\xE2\x80\x9A\xC3\x82\xC2\xB0+Zorrilla+14 http://example.com [R] (UTF-8) and/or RewriteRule ^/?es/47006+P\xC3\x82\xC2\xB0+Zorrilla+14 http://example.com [R] (CP1252)?

    The + is really a +, not a space in actual request?