I am moving a .NET application over to a Rails application.

I need to re-write the url:

www.example.com/users/user.aspx?userid=1231

to

www.example.com/users/1231

How can I do this?

I don't want a redirect, I want it to seem like I am responding to this request "normally", but internally my Ruby on Rails application is going to think the URL was the 2nd url I posted.

link|improve this question

51% accept rate
feedback

1 Answer

rewrite ^/users/user.aspx$ /users/$arg_userid?;

The trailing question mark prevents the query string from being appended to the rewritten URI.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.