Art Of Programming

musings by Dmytrii Nagirniak

Fake Wild-card Mapping in Graffiti CMS

I have just installed Graffiti CMS to play with it.
After the installation I created a test post and only after that noticed the URL:
http://localhost/Graffiti/first-post
Notice there is not any extension and the URL looks very clear. But HOW? I did not do neither of the following:
  1. Added wild-card mapping;
  2. Configured Web.config with IIS 7 as I have IIS 6;
  3. Run any script or something.
Then I looked at the folder of Graffiti CMS and found it has the folder named “first-post” in the root which contains only one file - Default.aspx.
The Default.aspx is auto-generated and just has some settings. The content is stored in the database.
Do you see now how this wildcard-mapping works?
It just allows IIS to handle friendly-urls by creating a real resource. But the actual URL that gets processed on the server is:
http://localhost/Graffiti/first-post/Default.aspx
That does make assumption that IIS has Default Document with name “Default.aspx”. Removing it will kill the whole idea of such friendly-urls.
The idea is dead simple and indeed a good one.
I am not sure weather I like it or not. One thing I definitely don’t like so far is the fact that the folder will get polluted with all those folders and files.

Comments