logo

Mapping Folder URLs in Domino

Anybody remember last September I went through a phase of wanting to switch this site over to PHP? Back then (I've since decided it was a stupid idea) my main concern was breaking links that are out there pointing to URLs that contain the A55692 directory. This was always going to be a problem whenever I moved from that server, no matter where I went. Even now that I've moved to a dedicated server on Domino it was still an issue. The worst-case scenario was that I simply create a folder called A55692 and place all databases in there. Not nice. Instead I played round with the Web Configuration documents and created a URL -> URL Mapping. Here it is:

URL - URL Mapping

Not surprisingly, it works. Try it out with any old links you may have or by clicking here. And after all that messing round with PHP code! Domino's not half bad after all ;o)

Disclaimer: Whilst this is probably second-nature to most of you, setting up my own server simply reminds me how little much I know about Domino Admin.

Comments

    • avatar
    • David
    • Thu 22 May 2003 08:02

    Well as an administrator rather than a developer it's about the first thing I've understood on this site :-)

  1. I've been fooling around with PHP too and was trying to get my domino server to host php pages, but haven't gotten it to work yet.

    Any ideas on this? Might be an interesting article :-)

    • avatar
    • Jake
    • Thu 22 May 2003 10:24

    Jean-Marie. If I remember right I think you can do it. But you have to run PHP as an executable rather than a CGI plugin and this is not as safe. Also, all URLs contain the php.exe file as well.

    • avatar
    • ianb
    • Thu 22 May 2003 10:54

    Jake,

    Over here at the IBM software Symposium in Munich and wondering why you haven't just just gone straight to websphere as we're all going to have to do soon.

    Just found a guy who's running linux and domino on an XBox clustered on his network - now that's style!

    • avatar
    • Chris Melikian
    • Thu 22 May 2003 12:55

    I asked the Lotus Knowledgebase Support team to do the same thing when they moved the old www.support.lotus.com site to the IBM support site. Would have taken about 10 mins to write a mapping like that to redirect all those links to KB articles in Notes.net forums to the new site rather than making them dead links.

    Did they do anything? Did they hell!!

    Well done Jake for thinking about your audience...!

    • avatar
    • Larry Lizzard
    • Thu 22 May 2003 17:46

    Jake,

    Is it also possible to map "store.nsf/" to "/"? This would shorten the url in the browser?

  2. Interesting question. I've been playing aroung with that idea for some time, but didn't come to a working solution.

    So, for now I assume that you have to keep the filename in all URLs, as long as you keep using the Domino http task.

    Jake once pointed us to {Link} . While this site is domino-driven, all the links are nice-looking. But I don't think you can do that using domino on it's own.

    I would be happy if someone would disagree, though. :-)

  3. BTW: Jake, how come, your PC is set up to use the american date format MM/DD/YYYY?

    Used to think Mansfield was lokated in UK, just like London ...

    • avatar
    • Jake
    • Fri 23 May 2003 04:43

    Larry, nice idea, but I'm not sure it would work. When you visit a URL that includes Domino mapping, the irrelevant part of the URL (A55692 in my case) remains intact. So if the user typed in store.nsf the Domino server couldn't map this to the root as it would not find any database. Also, if you did it the other way round, you would map all URLs to one database. Does that make sense? I think I confused myself now ;o)

    Harkpabst - You're right, I think. You can't do it with *just* Domino. Reader's Digest used Apache as the web server ("stack").

    The date format is indeed American. If I changed it now there would be differences between what's already there and new posts. Confusing no?

    • avatar
    • Pat
    • Fri 23 May 2003 07:58

    Jake - you can do nice URLs with *just* Domino...

    If you look at {Link} the /courses/ is defined by a "URL-->Directory" mapping that takes the Incoming URL string:/courses/ and maps to Target server directory:/8025653C0039BA28/ (which is the database unid, of course).

    The one thing I want to get rid of is the ..&count=-1 parameter. You could set the global view count (in the server document, Internet Protocols - Domino Web Engine - Default lines per view page) to -1 and it works, but webmail users start complaining! ;)

    • avatar
    • Jake
    • Fri 23 May 2003 08:35

    Nice plug there Pat ;o)

    • avatar
    • Pat
    • Fri 23 May 2003 09:02

    *shakes fist* Damn you - you meddling kids!!!

  4. Pat, correct me if I'm wrong, but this approach restricts you to having one physical database file for every top-level logical folder (or nested folder, if you want to), no?

    I must admind, that I never tried Domino with Apache or IIS as the http server.

    • avatar
    • Larry Lizzard
    • Sun 25 May 2003 17:36

    Pat,

    Really nice site and urls in your link. Some questions:

    - why do you use the ! (exclamation mark) in stead of the ? (questions mark) in your urls?

    - why don't you skip the !opendocument and !openview extensions to your urls?

    - why do you sometimes use + (plus signs) in your urls? I sometimes had problems with them, escpecially when opening pdf attachments.

    To get rid of the &count=-1, would using embedded views and setting the lines to display to 4000 help?

  5. I'm not Pat, but I still feel intitled to give my 2 cents on your questions.

    Exclamation marks were intended to make sites more accessable by web crawlers. At least in the past, search engines skipped the Query_String (the part following ?) when indexing websites. This was considered to indicate dynamically generated content, so following those links might degrade server performance. Furthermore the content might have be taylored to each specific surfer in some way (e.g. depending on surfers IP address), so the results might not have been worth indexing, anyway. Problems with this policy are: All URLs that differ in the Query_String only, are considered to be equal, links that depend on a Query_String, might even point to an error page.

    I said "were intemded", because looking at our weblogs, I don't think that this is still the case, at least with Google. As (probably) the majority of internet contents are provided by some sort of CMS nowadays, this behaviour is no longer appropriate. Additionaly, the exclamation mark is no longer accepted on R6 servers by default. Your have to manually add an environment variable to make Domino 6 recognize these URLs, when they are calculated inside your application. This does however not apply to domino-generated links (if you enabled the corresponding option in the server document). Consequentially, I consider the use of exclamation marks to be deprecated.

    While omitting openView, openDocument, etc. URL commands may make URLs look more pretty, I don't see any technical advantage here, quite the contrary: Before opening this resource, the server has to check wether the named element to open is a view, a form, a page or whatever. This should be potentially slower than using full URL commands.

    Plus signs on the other hand are - to the best of my knowlege - perfectly legal replacements for blanks, as a more readable alternative to %20.

    Concerning your last point: What if the view you are accessing happens to contain 4001 docs? Yes, you wont see the last one and you won't even know. Why replace a mechanism that works fully dynamically with somethin static for no special reason?

    Let me know if you disagree.

    • avatar
    • Larry Lizzard
    • Mon 26 May 2003 08:17

    Hark,

    Thanks a lot, never understood the exclamation mark in depth and never thought of performance issues related to omitting ?openview arguments. I was only considering the fact that the ?openview arguments make URLs longer and thus the html of the page larger.

    On your last remark: you are right, but I just LOVE short and clear URLs, so I try to make webviews < 4000 documents (using &cat=xxxxx). 99.99% of all webviews already are, since nobody wants to wait for / scroll through a webpage with 4000 html lines.

  6. Hehe, I think in 99,9999% of all cases, your are absolutely right. :-)

    btw: Doesn't Mike Golding provide a list of the order, in which Domino searches for design elements, when no explicit URL command is used? But I might be mixing up something here.

  7. Thought you guys may be interested in some security mapping - basically these maps block anything coming in on {Link} Address and sends it to the default {Link}

    Redirection URL-->URL for IP Address (*default* --> {Link})

    Redirection URL-->URL for IP Address (*.ntf* --> {Link})

    Redirection URL-->URL for IP Address (*..* --> {Link})

    Redirection URL-->URL for IP Address (*/$d* --> {Link})

    Redirection URL-->URL for IP Address (*/$D* --> {Link})

    Redirection URL-->URL for IP Address (*/$%44* --> {Link})

    Redirection URL-->URL for IP Address (*/$%64* --> {Link})

    Redirection URL-->URL for IP Address (*/%24d* --> {Link})

    Redirection URL-->URL for IP Address (*/%24D* --> {Link})

    Redirection URL-->URL for IP Address (*/%24%44* --> {Link})

    Redirection URL-->URL for IP Address (*/%24%64* --> {Link})

    URL-->Directory for (/scripts/* --> cgi-bin)

    • avatar
    • Pat
    • Tue 27 May 2003 04:21

    Larry - thanks for the feedback!

    I would love to set 4000 as the normal rows per view but as we also run a fair few mail files off the same server, this would seriously impact their usage.

    I've kept the exclamation symbol in my URLs purely because I semi-forgot it was there. As Hark says this is probably not needed now, but once you start getting high lists with Google you don't want to start changing things...!

  8. Pat

    There is a way of displaying 4000 plus lines of data even if the server only allows say 250. It involves breaking down the 4000 plus view into smaller views and for speed use of a profile document as follows:

    Assume your 4000 plus view is ordered alphabetically. Break down the view into 26 hidden views

    Views

    Example Field is LinkName and assumes it is unique in each case

    Selection formula Select Form = FormName & (@UpperCase(@Left(LinkName ;1))="A") etc

    Write your column appropriately e.g

    "<TD NOWRAP><FONT SIZE=1 FACE=\"Verdana\"><b>ยท</b><A HREF=\"/" + @Subset(@DbName ; -1)+ "/0/" + @ReplaceSubstring(LinkName ; " " ; "+") + "!OpenDocument\"> " + LinkName +"</A></FONT></TD></TR>"

    Now for the use of the profile document

    This is required to ensure that the Domino server does not do 26 massive lookups each time you want the data - instead use a profile document with 26 computed @DbColumn fields and an agent that refreshes the profile doc every X mins or hours

    Then on your display form create 26 fields that lookup the relevant profile doc fields.

    Provided you are careful you should not hit the @DbColumn maximum size or the maximum field size constraints. The result is that the Domino server will refresh the profile doc in the background and the display form will do a quicker live lookup on loading. Page will still take a while to load but you can get your 4000 plus lines if you need them.

    All of above assumes that you are happy for the data displayed to be a little bit stale.

  9. Pat,

    Maybe I wasn't clear. There are two ways I know of embedding a view on a form. 1) with the $$Viewbody (check the Designer help file for details) and 2) from the Designer task bar do Create > Embedded Element > View. Right click on the view, select Display using HTML and set the Lines to Display to 4000.

    With some <table> tags and Pass thru HTML you can create beautiful views. You can mail me, should you have further questions.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Thu 22 May 2003

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content