Page not found error in published webs - 404 error

The default publishing options creates web pages that have the same name as the object's name (with spaces removed) up to a limit of 32 characters with the initial letter of each word capitalised. The web page name has the object's ID prepended to it to ensure it is unique.

In most cases this does not cause a problem. However, some web servers require that certain special characters are encoded when used as part of an URL. The most common characters that require encoding are &," and '.

For example if you had an object called

clive & nick are people

with an ID of 2096 its annotation page in a published web would be stored as

2096-Clive&NickArePeople.htm (or .aspx if you were working an ASP.NET publishing template)

This could cause a problem if the page was accessed without the & being encoded in the URL and you may get the dreaded "404 Error".

The simplest way to prevent these problems is to check the "Use strict filenames" option in the publishing dialogue and to specify the allowable characters by including a strict.dat file in your KB. This is described in the PCPACK help system Publish/Detailed Info/Publish with Strict File Names. The section from the help is repeated here.

Publishing with Strict Filenames

This setting allows the characters used in published filenames to be specified in a text file in the workspace folder of each knowledge base. All characters not specified will be removed from the names of all files generated by PCPACK. Publishing template files will not be processed and users should ensure that these conform to their particular requirements. The definition filename must begin with 'strict' and have an extension of '.dat'. eg. strictchars.dat, strict.dat.

The format of the file should be as follows:

  • The file must be in the knowledgebase Workspace folder.
  • Each line in the file must specify either a range or list of characters. A list may consist of a single character.
  • A range must be enclosed in square brackets. eg. [A-Z] specifies the range upper case A to upper case Z.
  • Each character may be specified with the character itself as above or with # followed by the character's ASCII code.
  • If the ASCII code is used in a range, then the code must be used for both the minimum and maximum in the range.
  • eg. [#65-#90] is equivalent to [A-Z]. [#65-Z] will be ignored.
  • A list may include any mix of literal characters and ASCII codes preceded with #. Do not separate list characters with spaces unless spaces are to be interpreted as legal.

Example to allow A to Z, a to z, 0 to 9, hyphen and underscore: