7 April 2002: SREhttp/2: Using the HOME_DIR SREHTTP2.CFG variable HOME_DIR: The "home directory" -- used as a text replacement whenever a ~ is encountered in a request selector. A typical value of this would be "Users/". Example: If: HOME_DIR='USERS/' and the request selector is: /~GERALD/RESUME.HTM then SREhttp/2 will use: /USERS/GERALD/RESUME.HTM ADVANCED OPTION: Specifying User Subdirectories In many cases, you may wish clients to have access to particular subdirectories of your "Users" directories. For example, all "students" may have space on the server machine, some of which is used for web, and some for "personal" purposes. The goal is to give clients direct access to the "web" related directories but not to the "personal" directories. This can be achieved by including a $ in the HOME_DIR parameter. Specifically, the $ is replaced by the substring between the ~ and the first / following the ~. For example: If: HOME_DIR=USERS/$/WWW and the request selector is: /~GERALD/RESUME.HTM Then SREhttp/2 will use: /USERS/GERALD/WWW/RESUME.HTM Summarizing, given a $ in the HOME_DIR. 1) SREhttp/2 reads the substring (of the request selector) between ~ and the first / following the ~ For example: GERALD 2) The substring is deleted from the request selector For example: /~/RESUME.HTM 3) The $ in the HOME_DIR is replaced with this substring (from step 1) For example: USERS/GERALD/WWW 4) The ~ in the modified request selector (from step 2) is replaced with the modified HOME_DIR (from step 3) For example: /USERS/GERALD/WWW/RESUME.HTM NOTES: * Caution: ~/ADIR/name.ext is different then ~ADIR/name.ext * HOME_DIR substitution occurs immediately after INTERNAL redirection. Thus, you can use ~ in a selector-specific internal redirection, and this ~ will be replaced by the HOME_DIR (see ATTRIBS.HTM for details on redirection). * HOME_DIR substitution occurs immediately before "adding a trailing slash". Thus, a request-selector of ~JOE2 could be converted to USERS/JOE2/ * HOME_DIR will not be attempted if an TEMP, PERM, or NOTIFY redirection has been specified. * HOME_DIR for ~ substitution is also used when resolving filenames requested in server side includes. * CAUTION: Since HOME_DIR is used in a direct textual substitution, only a mild degree of syntax checking is attempted. In particular, // are converted to /. To be safe, be sure your use of ~ is internally consistent.