Notes 9, rewriting URLs

回眸只為那壹抹淺笑 提交于 2019-12-06 06:57:57

If you use substitution rules like the following, you can get rid of the db.nsf part and call your XPages directly as example.com/xpage1.xsp:

Rule (substitution): /db.nsf/* -> /db.nsf/*
Rule (substitution): /* -> /db.nsf/*

However, you have to "manually" generate your URLs without the db.nsf part in e.g. menus because the XPages runtime will include the db.nsf part in the URLs if you use for instance the openPage simple action.

To completely control what is going in and out put your Domino behind an Apache HTTP and use mod_rewrite. On Domino 9.0 Windows you can use mod_domino

You can do it with a mix of subsitutions, "URL-pattern" and paritial refresh.

I had the same problem, my customers wants clean URLs for SEO.

My URLs now looks like these:

www.myserver.de/products/financesoftware/anyproduct

First i used one subsitution to cover the folder, database and xpage part of the URL. My substitution: "/products" -> "/web/techdemo.nsf/product.xsp"

Problem with these is, any update on this site (with in redirect mode) and the user gets back the "dirty" URL. I solved this with the use of paritial refreshes only.

Last but not least, i uses my own slash pattern at the end of the xpage call (.xsp) In my case thats the "/financesoftware/anyproduct/" part. I used facesContext.getExternalContext().getRequestPathInfo() to resolve that URL part.

Currently i used good old RegExp to get the slash separated parameters back out of the url, but i am investigating a REST solution at the moment.

I haven't actually done this, but just saw the option yesterday while looking for something else. In your Xpage, go to All Properties, and look at 'navigationRules' and 'pageBaseUrl'. I think you will find what you are looking for there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!