NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_serverrootproc(n) 4.99.19 naviserver "NaviServer Built-in Commands"

Name

ns_serverrootproc - Callback for determining server root

Table Of Contents

Synopsis

Description

If virtual hosting is enabled, this function can be used to set a callback for determining the server root directory based on the host header field of the current connection.

COMMANDS

ns_serverrootproc cmd ?args?

The command registered with ns_serverrootproc may have the host appended as the last arg before it is executed

EXAMPLES

  ns_serverrootproc nstest::serverroot arg
  proc nstest::serverroot {{host ""} args} {
      if {$host ne "" } {
          set path [eval file join testserverroot $host $args]
      } else {
          set path [eval file join testserverroot $args]
      }
      return $path
  }

See Also

ns_locationproc

Keywords

callback, global built-in, hosting, virtual