Building a Domino website: friendly URLs
Oops... To my big surprise I saw this article popping up in my Google Reader this morning, while in fact I was only just started on it. I was working on it, but must have touched the 'Published' radio button before I saved.
The last step towards friendly URLs is asking the Notes administrator to make a Server redirection rule, in my case to redirect all /hobby/ to the address of my database. These are my rules at present:

Benefits of friendly urls
- Because the database path is replaced with the redirection, the database can be moved without any change to the web path: you just change the redirection rule accordingly.
- You also get the shortest possible, human readable and search engine friendly URLs.
- You can use the path, view alias and document key even to transmit very strong marketing messages. How about:
http://blog.lotusnotes.be/domino/rocks-as-hell
Technical description
Every Notes database must have one: a shared field or field in a shared subform computing the web path of the database. We use to do it like this:
"/"+@ReplaceSubstring(@LowerCase(@Subset(@DbName; -1)); "\\":" "; "/":"+")+"/"
Until this came available:
"/"+@WebDbName+"/"
But now, after the redirection, my DbPath field is just this:
"/hobby/"
All formulas that have to calculate the path of the database use this field. However, a lot of references are kept in computed fields in order to use them in view columns. So I have to recalculate these fields for all documents with my favorite agent, the one I have used more than any other ever: 'Refresh Selected':
@Command([ToolsRefreshSelectedDocs])
If you ever get your hands on one of my databases, look for this agent and run it on all documents. It might release you from all (computer-related) problems.
Conclusion
I am very surprised that I still find so many websites on Domino having these ugly Notes URLs. Anyway, my hobbysite now has friendly ones: Fantasite - http://www.tangosite.com/hobby/
Comments
19/07/2007 22:53:58, Tommy Valand
Hi! I just discovered your blog (in search of the possibility of making a CMS XHML-compliant on Lotus Domino). You have some very nice articles!
In march this year, I posted a proof-of-concept of using $$ReturnGeneralError as a "shortcut" for search/making search readable. URL: http://dontpanic82.blogspot.com/2007/03/misusing-returngeneralerror-as-shortcut.html
I have yet to find an application to use this on, but best-practices wise, what do you think of this? You could probably do the same mapping on the server, but not all admins are fond of a lot of application-specific settings on the servers.
To add a comment, log in or register as new user. It's free and safe.