Now all urls in your application can look like:
http://yourdomain.com/welcome?readform. No need for /myfolder/mydb.nsf/ in the url. Very clean to look at, very easy to mail to other people, very easy to reference internally in the design of the database. Thanks to the creative use of website rules.
I figured it out (at last) how to succesfully map a domain name url directly to a database. Here are the steps I took:
1) Set the DNS settings of
http://yourdomain.com to the IP number of the server. (or do this for www.yourdomain.com, it also works)
2) Open Administrator > Configuration > Internet Sites
3) Click on Add Internet Site/Web button
4) Fill in the fields on the Basics tab:
Descriptive name for this site: yourdomain.com (exact name is not necessary)
Host names or addresses mapped to this site: yourdomain.com, yourdomain.com/
5) Fill in the fields on the Configuration tab:
Home URL: (empty this field!!!!!)
6) Click on Save & Close button
Now you have just created a Website Document, that is not reffering to anything yet. You use the rules for it.
7) Open the just created Website Document
8) Click on Website/Create Rule button
9) Fill in the fields on the Basics tab:
Description: (you can leave blank)
Type of rule: Substitution
Incoming URL pattern: /*
Replacement pattern: /yourfolder/yourdb.nsf/*
When a user types in the browser:
http://yourdomain.com, he is directed to the right database. In your application you can now remove probably all @webdbname formulas or fields that calculate the database path, since the rule takes care of this now.
This rule alone is not sufficient. Notes generates many references to the database name automatically. E.g. if you submit a form, the url notes generates is something like yourfolder/yourdb.nsf/yourform&Seq=1. Notes also puts the database name in hotspots, and other references. So also add the following rule to handle these requests:
10) Create a new rule and fill in the fields on the Basics tab:
Description: (you can leave blank)
Type of rule: Substitution
Incoming URL pattern: /yourfolder/yourdb.nsf/*
Replacement pattern: /yourfolder/yourdb.nsf/*
Since this rule has a longer incoming url string, this is executed in these cases, and not the other substition rule.
Now all urls in your application can look like:
http://yourdomain.com/welcom?readform.
To increase the stability of your database, and to keep the short urls, try to exclude in the design of the database as many references to the database name as possible. E.g. use html views, that do not contain the name of the database in the urls you create (check this thread at
http://www.codestore.info/store.nsf/0/2BD4138DD46CDB5386256998005E0127 on how to do this). If you use Notes views, they contain the name of the database in it. If you don't do this, navigating through your site will make the database name come back in the browsers' address bar (
http://yourdomain.com/yourfolder/yourdb.nsf), which is what you're trying to avoid.
Recommended readings:
http://www.lotus.com/ldd/today.nsf/0/7d8c177a1516fe1585256cb8004af5c3
http://www.lotus.com/ldd/today.nsf/0/8f68a440f2182b1e88256a9a005d40da
http://www.lotus.com/ldd/today.nsf/0/b86a878b9ae5ee0d85256ad8000813a6