001
001

Reputation: 65137

Make friendly URL in ASP.NET

how do i make my web app friendly URL?

currently my app URL looks like this

http://www.domain.com/Page.aspx?article=103

but I would like to display the URL to look like this

http://www.domain.com/Page.aspx?Google-likes-url-friendly

what would i need to do?

Upvotes: 1

Views: 4269

Answers (6)

Abhendra Tiwari
Abhendra Tiwari

Reputation: 19

Use Microsoft.AspNet.FriendlyUrls Nuget Package to Make this easy

Upvotes: 0

Matthew Groves
Matthew Groves

Reputation: 26141

Another option is to write a 404 trap: http://codeeleven.blogspot.com/2007/11/rewriting-urls-in-aspnet-without-using.html

Hacky, but an effective last resort.

Upvotes: 0

Steve
Steve

Reputation: 5952

Keep in mind the url-rewrite module metioned above only works with IIS7/7.5. And make sure your host, if you are using one, has it installed.

For IIS6, IIS5, take a look here:

Url Rewriting with ASP.NET

ASP.NET routing and URL rewriting will both work. Here are the differences:

http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/

Upvotes: 0

Nate Dudek
Nate Dudek

Reputation: 1265

If you're using ASP.NET 4.0 or .NET 3.5 SP1 (or ASP.NET MVC), you can use the routing module.

ASP.NET Routing @ MSDN

There is a good walkthrough at http://msdn.microsoft.com/en-us/library/dd329551.aspx

Upvotes: 2

Jaxidian
Jaxidian

Reputation: 13511

Look into using ASP.NET MVC. With it, you could have a URL that's even better: http://www.domain.com/Article/Google-likes-url-friendly

Upvotes: 2

DarthVader
DarthVader

Reputation: 55032

check out

http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

you will need to download and install a module.

Pretty easy to use and configure.

Here is the introduction :

http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/

Upvotes: 6

Related Questions