The system uses an automatically generated numerical addressing schema to assign page URLs.
The reasons and benefits of this are described in 'The numerical addressing schema'.
There is also a need to be able to assign specific 'user-defined' URLs to pages. DirectURLs give you this ability.
Why use DirectURLs?
- They allow you to create memorable names for pages: www.domain.com/support (as opposed to www.domain.com/2820 or whatever)
- They allow you to assign multiple names to the same page, useful to catch common mis-spellings, or when several topics are covered on the same page.
- They allow you to migrate from older static sites without breaking users' bookmarks and external links that were pointing to old page names.
- They allow to you change the destination so www.domain.com/offer could point to one page today, and later point to another page with a different offer (there are also other ways to achieve redirection, such as the Redirect item in the Layout Manager)
- DirectURLs are important for optimizing Search Engine Optimization
How DirectURLs work
When a user attempts to browse to a DirectURL, there is no matching page to handle the request, so the request falls through to the web server's '404' handler. Normally this would simply respond with the standard '404 page not found' screen, however before resorting to that it first checks to see if there is a matching DirectURL. If there is, it redirects to the relevant page.
Types of DirectURL
There are two types of DirectURL, distinguished by where the DirectURL is entered:
Page-based DirectURLs alow you to assign one or more DirectURLs to a page. Read how.
Form-based DirectURLs allow a text field in a Form to be used to define the DirectURL. Rather than just displaying a page, this will tell the system to display a given page with the matching Form record displayed on it (formatted according to the Queries embedded on the page). This is useful, for example, if you want to provide DirectURLs based on dynamic structured information like a product catalog.
- The destination page for a form-based DirectURL is specified in the Form component's field editor.
- The DirectURLs are specified by entering values in the text field of the Form record.
Creating a Custom 404 page - overriding the standard '404' page
You can create your own page to be displayed when there is no matching page to show, by adding a Page-based DirectURL of * (ie a single asterisk) to the page you want to appear.
This could typically be a 'prettier' page-not-found page, or take the user to a search page, or perhaps to the home page of the site.