iphlex systems web generation
iphlexwebphlexdocumentation > 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.

  • C:\web sites\site1\index.html
  • http://www.iphlex.com/site1/index.html
A relative address specifies where to find something relative to where the address is being used, e.g.
  • index.html
  • ../../site2/index.html

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.

see also:

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:

  • For the on-line files, the server address is set to be identical to that of the page groups making up the rest of the iphlex site, i.e http://www.iphlex.com/. Relative addresses are then generated for other parts of the main site.
  • When producing the files for local use, the server address is set to a location on the local machine, e.g. C:\webphlex\webphlex_doc\. Absolute addresses are then generated for other parts of the main site, while internal references within the documentation files remain relative.

see also:

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.

  • Suppose two web sites, site1 and site2, are located on different web servers but are being maintained on the same local machine, their files being generated in directories C:\web sites\site1 and C:\web sites\site2. File C:\web sites\site1\images\image001.jpg can be accessed from a file in directory C:\web sites\site2 using the relative address ../site1/images/image001.jpg.
  • If site1 is uploaded to the server location http://www.iphlex.com/site1, then to access the same file from site2 (either from the local machine or from its own web server), an absolute address will be needed: http://www.iphlex.com/site1/images/image001.jpg.
Alternatively, different page groups may generate their files in local locations (on different disk drives, or different network machines) which cannot be accessed using a relative address, but then uploaded to the same server. Absolute addresses will then be needed locally, during the development phase, but these can be replaced by relative addresses before the files are uploaded.

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.

see also:

top of page
iphlexwebphlexdocumentation > web generation Copyright © 2006 iphlex systems