Wednesday, February 27, 2013

Fighting for control of URL in Domino

We have really annoying problem for years with our URLs on all websites based on Domino. We use classic approach because we want control all tags + we like jQuery more etc. Our problem is about mandatory action [?open | ?opendocument] for pages with parameters, so if you want to add parameters to your page (i.e. param1=123) you have to add [?open | ?opendocument] just after your URL and only then you are allowed to add parameters.

Not really a huge problem, however we want to use new tracking code from google. That tracking has problems with [?open | ?opendocument]: it does not work correctly in case if first parameter is ?open. So now its blocker for us and we want to fix it for all another cases as well. We want to have possibility get rid off ?open | ?opendocument

Question in few words: "is it possible to get this URL working?"
http://www.e-conomic.com/accountingsoftware?parameter=123
instead of this
http://www.e-conomic.com/accountingsoftware?open&parameter=123

We've tried redirect, substitutions - no success ofc :(.

Next in my queue is DSAPI and I'm sure it can solve that problem (at least from documentation) however I'm not able to do that due to my experience with DSAPI and very very low information in the web.

I've played with different events in DSAPI: kFilterStartRequest, kFilterRawRequest and kFilterRewriteURL and tried to change incoming URL from request but did not success with it. Does any of you guys can give me tips :) what I do wrong or maybe there is another solution how to achieve that quest?

3 comments :

Carl Tyler said...

The View had an article on how to use Google Analytics with Domino, not sure if you have access:

http://www.eview.com/eview/volr6.nsf/2e1e8702485c7e3d852573d00056eed8/a0b588c1ac55768e8525784e005d04da?OpenDocument

Miguel Calvo said...

What about placing and Apache proxy in front of Domino and rewrite the URLs on the fly ?
By the way, the Domino 9 release will have the option to run an IBM HTTP server in front of Domino. Maybe that could be an option.

Bjørn Cintra said...

It is possible to get 'proper' URL's on Domino, but not in 'classic', and not using url parameters (as soon as you add parameters, Domino will complain).
You can, as mentioned, use a reverse proxy in front (we use Nginx) to rewrite the url and add ?open when a query string is detected.
If your only reason to not use xPages is because you want full control, and to use jQuery, there are several other options, you can use an xPage as an agent, and write html directly to the stream (examples are on the web), or you can use a servlet trough the OSGi runtime. Both work perfect, and will give you full control on everything, including the urls.
We combine this with Freemarker to give us the control we need for our Domino based CMS (example: http://www.niva.no )