When you create links to JavaServer Pages (JSPs) that are stored in Domino databases, you must omit the NSF file extension in the URL. But it's easy to forget to omit the file extension, so why not avoid this problem use Web site rules.
Suppose you have a Web site http://www.domain.tld which is hosted in a db at http://www.domain.tld/dir1/dir2/db.nsf.
Normally, you build links as follows:
Domino URL:
http://www.domain.tld/dir1/dir2/db.nsf/xyz?command
JSP (omit the nsf):
http://www.domain.tld/dir1/dir2/db/xyz.jsp
Let's automate this and shorten the URLs at the same time by creating two simple Web site rules.
- Open your Domino Directory in your Lotus Notes client.
- Go to the Servers - Internet Sites view.
- Open a Web site document, then click the Web Site button, then click Create Rule from the menu.
- In the Web Site Rule document, select Substitution in the Type of rule field.
- In the Incoming URL pattern field, enter:
/* - In the Replacement pattern field, enter:
/dir1/dir2/db.nsf/*Note that the path reflects the previous example, so should be changed to reflect your environment. - Save and close the document.
- Repeat Steps 3 to 7 for a second Web Site Rule document, enter the following:
- In the Type of rule field, select Substitution.
- In the Incoming URL pattern field, enter:/*.jsp- In the Replacement pattern field, enter/dir1/dir2/db/*.jspNote that the directory path reflects the previous example, so should be changed to reflect your environment. - Close the directory.
With these rules, instead of creating a link with a long URL like:
http://www.domain.tld/dir1/dir2/db.nsf/xyz?command
you can use nice short URL:
http://www.domain.tld/xyz?command
And for JSPs, instead of using:
http://www.domain.tld/dir1/dir2/db/xyz.jsp
you can use:
http://www.domain.tld/xyz.jsp
That's all! No more differentiating between building links to Domino design elements and to JSPs. And all your URLs are short and easier to remember.




