-1

I'm creating a site, and i need to have my urls mapped . I want to avoid losing css during mapping. I want something like this..

http://www.vitagamer.net/Game.aspx?id=12

to

http://www.vitagamer.net/games/this-is-a-game-name/

now I've been thinking about the following algorithm..

  1. receive the requested url..
  2. break into parts, and search database for id associated with "this-is-a-game-name".
  3. serve the http://www.vitagamer.net/game.aspx?id=12 page

I've been looking on the web but i'm confused. How do I do the mapping? how many ways are there?

is there a difference between rewriting and mapping?


Update

I also need to add hyperlinks to my pages that are shown like

http://www.vitagamer.net/games/gamename/

should I just do things with strings? or there's a more efficient way.

1
  • I strongly suggest you to read Scott's blog post about Url Rewritting Commented Dec 25, 2012 at 23:32

3 Answers 3

1

As you seem to be on Asp.Net WebForms, I would suggest writing a HttpModule to catch the incoming requests and rewrite the URLs.

This is a duplicate question and I've found my suggested answer as the second one here: ASP.NET URL Rewriting

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

1 Comment

thnks for the reply, i'm reading about httpmodule..
1

You should look into Microsoft.AspNet.FriendlyUrls to easily use routing and get "friendly urls" or "extensionless urls" for ASP.Net Web Forms.

Here's a primer from Scott Hanselman

Comments

0

IIS 7 has support for URL Rewrite, you can use IIS interface to manage URL(s): http://www.iis.net/downloads/microsoft/url-rewrite

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.