Chapter 12. Site Redirection

12.1. Site Redirection

JBoss Portal includes a mechanism to redirect user to a different site within the portal based on the characteristics of their browser. This is especially useful for redirecting users to a mobile optimized site when detected they are accessing the portal from a mobile device.

12.2. About Site Redirection

Redirections can be based on various criteria, specified as conditions:
  • The user agent string of the browser accessing the site
  • Any property which can be determined via javascript. This can include things like screen size, pixel density and if the device supports touch or not.
Mapping nodes between original and redirect site when performing the redirect is also available, allowing greater control over what page within the site a user will end up on when a redirect is performed.
The following sections will briefly explain how to configure and setup the site redirection service using the administration user interface.
For details on how to configure site redirects using xml configuration files, see the Administration and Configuration guide chapter Site Redirection

12.3. Manage Site Redirections

To manage site redirection follow these steps:

Procedure 12.1. Manage Site Redirection

  1. Navigate to GroupAdministrationSite Redirects and Import Export.
    Shows the Import Export Menu of the site redirection

    Figure 12.1. Site Redirection-Import Export Menu

  2. Select the site for which a new Site Redirect rule is to be created. The Sites screen lists the site types as classic and mobile.
  3. Existing Site Redirects listing will be shown, along with the Add Redirect button. Click the Add Redirect to add a new one or click the Configure (wrench icon) to configure an existing one.
    The classic Site option shows the Add Redirect button and the Configure icon.

    Figure 12.2. Listings

  4. Once a Redirect is created, a name must be given and selected the site where it will redirect to, based on the conditions to be configured. There is also a toggle indicating whether the redirect is currently enabled (ON) or disabled (OFF). By default it will be disabled on creation.
  5. Click ConditionsAdd Condition to define the conditions which will trigger the redirect.
  6. In the conditions modal, a name must be given to the Condition (a default name is created).
    The Add Condition screen shows the name of the condition and a Save changes button.

    Figure 12.3. Add Condition

  7. In the User Agent String section valid Java regular expressions must be used in the Contains and Does not contain entries, which will be evaluated against the browser User Agent string. New conditions can be added (which will be overwritten with existing ones) by clicking the Add button (plus sign icon) and existing ones may be removed by clicking the Delete button (trash icon).
    The Property screen lists the operators such as Equals, Greater than, Less than, matches and Between. These operators define the condition for existing properties.

    Figure 12.4. Condition Property

  8. Predefined properties can be added to assist on condition matching, by clicking the Add Properties button. Different operators are available for defining these properties.
  9. Click Save Changes to create or update the condition or Cancel to revert the creation or changes.
  10. Conditions can be sorted (for performance reasons, having the less expensive ones on top, for instance) by dragging the condition row and dropping in the desired position.
  11. Configure Node Mappings maps landing site nodes to redirected site nodes. By default this functionality is enabled, to change select Use node name matching.
  12. Click Add Mapping to add a new node mapping. Existing Node Mappings can be deleted by clicking the Delete Node Mapping.
  13. Nodes can be selected by clicking the View Node List both for the Origin and for the Redirect sites.
  14. Select a default action for unresolved nodes from the drop-down menu.
  15. Click Save Changes to create (or update) the Site Redirect or Cancel button to cancel all the changes.
  16. Redirects can be sorted (for fine-graining purposes, such as having a mobile and a touch site redirect, for instance) by dragging and dropping in the desired position.
  17. Redirects can be deleted by clicking the Delete Redirect button (icon trash) and confirming or canceling in the confirmation modal, as desired.

Administrator Credentials Required

Creating, editing and deleting a portal redirect requires access credentials that only an administrator may set up.