# Trouble with rewrite module and uri\_escape (and patch)

**URL:** <https://www.ruby-forum.com/t/trouble-with-rewrite-module-and-uri-escape-and-patch/192442>\
**Category:** NGINX\
**Created:** [July 30, 2010, 12:03pm UTC](https://www.ruby-forum.com/t/trouble-with-rewrite-module-and-uri-escape-and-patch/192442 "2010-07-30T12:03:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daisuke\_Murase\_Styp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Daisuke\_Murase\_Styp](https://www.ruby-forum.com/u/Daisuke_Murase_Styp)\
**Post date:** [July 30, 2010, 12:03pm UTC](https://www.ruby-forum.com/t/trouble-with-rewrite-module-and-uri-escape-and-patch/192442/1 "2010-07-30T12:03:21Z")

</div>

Hi,

I have nginx/0.7.67 and a following rewrite setting:

```
rewrite ^/entry/(.*) /entry?title=$1;

```

When request uri contains %3b (escaped ;), it’s decoded like following:

```
Request: /entry/abc%3bdef
Result: /entry?title=abc;def

```

But %26 (escaped &) is not decoded:

```
Request: /entry/abc%26def
Result: /entry?title=abc%26def

```

At HTTP URI spec, ; should be treated as query separator equal to &  
IMHO

I wrote quick fix for this:

> <https://gist.github.com/typester/500097>

I don’t know this is correct way, but I want to fix this problem.  
Review this please.

Regards,

–  
Daisuke Murase (typester)

---

<div class="post-metadata">

**Author:** ![Daisuke\_Murase\_Styp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Daisuke\_Murase\_Styp](https://www.ruby-forum.com/u/Daisuke_Murase_Styp)\
**Post date:** [July 30, 2010, 3:27pm UTC](https://www.ruby-forum.com/t/trouble-with-rewrite-module-and-uri-escape-and-patch/192442/2 "2010-07-30T15:27:40Z")

</div>

On Fri, Jul 30, 2010 at 07:01:42PM +0900, Daisuke Murase (typester)  
wrote:

> I don’t know this is correct way, but I want to fix this problem.  
> Review this please.

You are right, thank you.

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**
