Posted By: fabian | Sep 4th @ 9:06 AM
page 1 of 1
Comments: 5 | Views: 502

I have noticed that the each post in the forum contains the title of the post. That is pretty neat! Smiley

 

How do you do that?

 

Do you programmatically create a new file on disk for each post or are you using some kind of URL rewrite feature?

 

If it is the latter can you explain how to do that or point me in the right direction. I would like to do something similiar on my own site.

 

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

It's URL rewriting. How you do it depends on your setup. With IIS7 you can use an HTTP module or the official IIS7 URL Rewrite Module. With older versions of IIS you can still use an HTTP module, or put some code in global.asax, but then it'll only work for file extensions that are routed through the ASP.NET runtime.

stevo_
stevo_
Human after all

The core concept, and what something like url rewrite is doing (although url rewrite is sort of missing the point and should exist as a legacy device - because it acts to map a request not to an action, but to another 'internal request' which then results in an action) is that modern web servers don't purely work on mapping the incoming url path to a local path anymore, they actually initialize a bunch of modules that can listen to all requests coming in (iis7 more so), and a module can then choose to initialize a handler for the request if it thinks it should handle it.. you can also directly bind handlers to urls in the web.config..

 

This is specifically how IIS works, other web servers may choose a more direct approach to pattern matching urls to 'delegates' yadda yadda.

SlackmasterK
SlackmasterK
I write my OWN blogging engines

Silly me, writing my own handling for it and not using fancy modules Sad

Duncanma
Duncanma
Just Coding for Fun...

You can also use the URL routing features in .net 3.5 ... often associated with MVC, this feature is actual decoupled and works here: http://msdn.microsoft.com/en-us/magazine/2009.01.extremeaspnet.aspx

 

page 1 of 1
Comments: 5 | Views: 502
Microsoft Communities