![]() |
web generation
iphlex > webphlex > documentation > web generation |
show contents
hide contents |
|
| ||
| ||
| ||||
|
top of page
| ||||
|
absolute and relative addresses
An absolute address (URL) specifies where to find something, regardless of where the address is being used, e.g.
It's generally much better to use relative addresses in a web site rather than absolute ones. This not only saves some space but, more importantly, the internal addresses will continue to work if the pages are moved to a different server. webphlex allows a web site to be spread across different local disks or network machines, and/or across different web servers, independantly of one another. The system will calculate the correct addresses, using relative addresses where possible.
It can sometimes be useful to use an absolute address even when a relative address could be used, e.g. when the URL is to be used as input to a Javascript routine or a server-side application (CGI). This can be achieved using the parameter ABS.
| |||
|
top of page
| |||
|
local and remote locations
For the purposes of this documentation it is assumed that output files will be generated on one computer (the local location), and uploaded to another (the remote location) for use. A local location must be specified for each page group, as that's where the generated files will be placed. A remote location can also be specified, in the form of a server address plus a location on the server. If all your output files are to be uploaded to the same server, and the directory structures of the local and remote locations are identical, then there's no reason to specify a remote location.
Although the remote location will normally be an on-line server (i.e. with an address starting with http://), it can also be a location on the local machine (e.g. C:\web sites\site1), or a network machine (e.g. \\machine2\C\web sites\site1).
When different versions of a site are to be generated for different situations (e.g. a site which is to be used on-line, but also distributed on CD), it can be useful to change the address of the server before generating the output files. This documentation, for instance, is generated twice: once for use on-line as part of the iphlex site, and once to produce the documentation files to be downloaded for local use:
| |||
|
top of page
| |||
|
how addresses are determined
All the files generated for a page group are placed in the same directory, so that references to generated files in the same page group are always relative addresses. E.g. a reference to index page 2, used in a detail page, might be index2.html; this will always work, no matter where the files are located.
The file locations (e.g. for image files) are normally specified relative to the main location of a page group; relative addresses can then be used for referencing these files. Suppose, for instance, that the main images for a page group are kept in directory 'images', which is a subdirectory of the page group's main location. The address for file image001.jpg will be generated as images/image001.jpg. This will work on the local machine, but also on any remote server to which the files might be uploaded.
Normally the page groups making up a web site will all be generated on the same local machine, and uploaded to the same server, and the directory structures will match on both. Again, identical relative addresses will work in both situations.
Things can get a bit more complicated, however, when page groups generated on the same local machine are uploaded to different servers. Relative addresses between these page groups generated to reflect the local situation will no longer work when the files are uploaded to their respective servers.
When an address is being calculated during page generation, and different addresses would be needed in the local and remote situations, the user is asked to decide which address to use. Local addresses can then be used in the development phase, and the site later re-generated, using remote addresses, before being uploaded to the server. A page group can also be set to always use local or remote addresses.
| |||
|
top of page
| |||
| iphlex > webphlex > documentation > web generation | Copyright © 2006 iphlex systems |