简体   繁体   中英

How do I rewrite URLs without access to IIS using C# and ASP.NET?

I am looking for a solution to rewrite URLs that have query strings so that the query string creates permanent link. For example: the query string ?u=test would become http://www.website.com/profile/test

I am new to URL rewriting, but am open to any suggestions you may have. I don't have access to IIS as I'm using shared virtual hosting.

You cant have extension-less URL without configuring it in the IIS as ISAPI wouldn't know how to handle that request.

Scott Gu has an excellent post with various approaches to URL rewrite.

You can use ASP.NET routing engine (introduced in .NET 3.5 SP1), see this article for quick-start: http://msdn.microsoft.com/en-us/magazine/dd347546.aspx

BTW, although outdated, you should read Scott Gu's post sighted by Danish for various options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM