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 looking to rewrite an url. Say I have an URL like www.domain.com/wall.aspx?Personid=1 and I want to rewrite that as www.domain.com/wall/personid/1 or even www.domain.com/wall/1. I am wanting it to do that same thing for all the urls on my page.

Is there a way to get everything before .aspx, then remove .aspx? and add / and remove = and add /?

How could I do this using IIS 7.5?

share|improve this question

1 Answer 1

The shorter version is nicer and cleaner I think. The following rewrite rule should do what you want:

<rule name="Rewrite Wall URL's" stopProcessing="true">
    <match url="^wall/(.+)" />
    <action type="Rewrite" url="/wall.aspx?Personid={UrlEncode:{R:1}}" appendQueryString="false" />
</rule>
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.