You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de> on 2007/12/20 17:20:25 UTC

[users@httpd] mod_rewrite redirect, how to keep url encoding utf8

Hi.

I've got some problem with mod_rewrites redirect behaviour.
I'll got some urls which may have some query parameters which are utf8 encoded 
like this:

/abcd/u1?myparam1=h%C3%A4llo

It works fine.

Now there should be some short urls which match to the long url above:

RewriteRule ^/ef(.*)$ /abcd/u1$1 [R,L]

The result is somehow different, the utf8 encoded parameter gets uri encoded 
again, so that the result looks like this (% => %25):

/abcd/u1?myparam1=h%25C3%25A4llo

which is not the result i've expected.
Any hints? Why it gets encoded again if mod_rewrite is participating?
Or is this "correct" behaviour that utf8 encoded uri is url encoded again?

thx

Torsten


Re: [users@httpd] mod_rewrite redirect, how to keep url encoding utf8

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Hm - never mind, NE - noescape does the trick, should have read more 
carefully, rtfm ;-)

Torsten

Am Donnerstag, 20. Dezember 2007 17:20:25 schrieb Torsten Krah:
> Hi.
>
> I've got some problem with mod_rewrites redirect behaviour.
> I'll got some urls which may have some query parameters which are utf8
> encoded like this:
>
> /abcd/u1?myparam1=h%C3%A4llo
>
> It works fine.
>
> Now there should be some short urls which match to the long url above:
>
> RewriteRule ^/ef(.*)$ /abcd/u1$1 [R,L]
>
> The result is somehow different, the utf8 encoded parameter gets uri
> encoded again, so that the result looks like this (% => %25):
>
> /abcd/u1?myparam1=h%25C3%25A4llo
>
> which is not the result i've expected.
> Any hints? Why it gets encoded again if mod_rewrite is participating?
> Or is this "correct" behaviour that utf8 encoded uri is url encoded again?
>
> thx
>
> Torsten