ASP.NET URL Rewriting *

Question

How do I rewrite URL's in ASP.NET?

I would like users to be able to goto http://www.website.com/users/smith instead of http://www.website.com/?user=smith

Answer

Try the Managed Fusion Url Rewriter and Reverse Proxy:

http://urlrewriter.codeplex.com

The rule for rewriting this would be:

# clean up old rules and forward to new URL
RewriteRule ^/?user=(.*)  /users/$1 [NC,R=301]

# rewrite the rule internally
RewriteRule ^/users/(.*)  /?user=$1 [NC,L]
< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/2262/" >ASP.NET URL Rewriting< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment