# How to rewrite these

**URL:** <https://www.ruby-forum.com/t/how-to-rewrite-these/183732>\
**Category:** NGINX\
**Created:** [February 19, 2010, 9:11am UTC](https://www.ruby-forum.com/t/how-to-rewrite-these/183732 "2010-02-19T09:11:42Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Glen\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@Glen\_L](https://www.ruby-forum.com/u/Glen_L)\
**Post date:** [February 21, 2010, 9:47am UTC](https://www.ruby-forum.com/t/how-to-rewrite-these/183732/21 "2010-02-21T09:47:51Z")

</div>

At last i found it… what i need is just \d in front of the regex…

---

<div class="post-metadata">

**Author:** ![Glen\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@Glen\_L](https://www.ruby-forum.com/u/Glen_L)\
**Post date:** [February 21, 2010, 11:01am UTC](https://www.ruby-forum.com/t/how-to-rewrite-these/183732/22 "2010-02-21T11:01:01Z")

</div>

Hu?  
Are you actually talking to Glen while replying my mail,  
or did I miss something obvious in the regex above?

Mauro Stettler a écrit :

---

<div class="post-metadata">

**Author:** ![Glen\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@Glen\_L](https://www.ruby-forum.com/u/Glen_L)\
**Post date:** [February 21, 2010, 11:03am UTC](https://www.ruby-forum.com/t/how-to-rewrite-these/183732/23 "2010-02-21T11:03:22Z")

</div>

sorry, i was talking to glen… no offense:-)

---

<div class="post-metadata">

**Author:** ![Glen\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@Glen\_L](https://www.ruby-forum.com/u/Glen_L)\
**Post date:** [February 21, 2010, 9:43am UTC](https://www.ruby-forum.com/t/how-to-rewrite-these/183732/24 "2010-02-21T09:43:10Z")

</div>

I think i’ve confused ☹

What i want is

[http://www.mydomain.com/$number/title](http://www.mydomain.com/$number/title)

i need to get that $number then rewrite it to  
[http://app.mydomain.com/redirect/$number](http://app.mydomain.com/redirect/$number)

I’ve read about regex, and seems that’s not the right thing to do

[Previous page](https://www.ruby-forum.com/t/how-to-rewrite-these/183732.md?page=1)
