VWcms Root Site  
 

[PREV][NEXT]

[PRINT]

A root site is one that does not need to use the site name to access its content pages (though of course that will work as well).  It resides at the root of the site's content and supplies all content not explicitly supplied by the web server.  With this configuration it is essential for the web server to explicitly handle all requests other than those expected to be serviced by VWcms.  VWcms becomes the site's default mapping (also see [unknown-302] below).

In the following example the one.example.net site has two paths not handled by VWcms, /download/ and /docs/.  The example shows the global VWcms configuration file for the site and using WASD mapping rules (as described in Site Configuration).

# VWCMS_CONFIG
[if-CGI-server_name]  one.example.net
[site-directory] VWCMS_ROOT:[ONE]
[site-name] one
[site-root] true
[if-end]

The site name is still required because it is used to access site resource (e.g. images, etc.)  These are WASD mapping rules; other platforms will need to extrapolate.

# WASD_CONFIG_MAP (HTTPD$MAP)
pass /docs/* /vwcms_root/docs/*
pass /download/* /vwcms_root/download/*
# VWcms site resources
pass /_* /vwcms_root/one/*
# mapping for root site
map /*
/cgiplus-bin/vwcms/one/* map=once

All non-VWcms resources should be mapped before the site is mapped as the default.  These rules must occur before the rule that activates the VWcms script (which can be anwhere further on in the rules).  The standard rule should looks like

exec+ /cgiplus-bin/* /cgi-bin/*

[unknown-302]

When a section is requested that does not exist the standard VWcms behaviour is to present the $$UNKNOWN$$ section.  The Vdub site (this) displays a site map in this section.  The [unknown-302] directive allows this behaviour to be changed to redirect to an arbitrary URL.  A parameter beginning with a "/" (slash)

[unknown-302]  /vms/

would redirect to a local URI, while

[unknown-302]  http://www.openvms.org/

to an external site, and a leading "!" (an exclamation point)

[unknown-302]  !http://more.example.com

will insert the URI/URL following the "!" and then append the original request URI and redirect to that.

Using this directive a root site can actually be made to "fall though" to another arbitrary resource or resources.

[PRINT]  [PRINT]