Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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