0

I'm in the process of writing a blogging software, as a learning excercise. Everything is going well, except I'm not sure how to create user-fieldly, SEO friendly URLs.

For instance:

http://myblogsite.com/blogs/default.aspx?ID=12

should be something more user friendly:

http://myblogsite.com/blogs/how-to-create-custom-urls-in-asp-net

I did look around, but couldn't find anything helpful. I want to create a permanent url and people can share and link to on otehr websites. On existing blog applications, it is referred to as "slug", I believe. But, I'm not sure how it works in Asp.Net.

Many Thanks!

2 Answers 2

4

Use URL routing in ASP.Net 4. For .Net 3.5 and lower the solutions are limited and more complicated, especially with IIS 6 because of how it handles extensionless requests.

routes.MapPageRoute("",
        "blogs/{blogName}",
        "~/blogs/default.aspx");

But you'd have to change ID to name and make it distinct. Also be careful of / slipping into it.

Sign up to request clarification or add additional context in comments.

Comments

1

Check out the IIS7 URLRewrite module.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.