开发者

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

开发者 https://www.devze.com 2023-01-30 05:02 出处:网络
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.webs

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消