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
- Navigate to → → .
- 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.
- Existing Site Redirects listing will be shown, along with the button. Click the to add a new one or click the (wrench icon) to configure an existing one.
- 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.
- Click → to define the conditions which will trigger the redirect.
- In the conditions modal, a name must be given to the Condition (a default name is created).
- 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 button (plus sign icon) and existing ones may be removed by clicking the button (trash icon).
- Predefined properties can be added to assist on condition matching, by clicking the button. Different operators are available for defining these properties.
- Click to create or update the condition or to revert the creation or changes.
- 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.
- Configure Node Mappings maps landing site nodes to redirected site nodes. By default this functionality is enabled, to change select Use node name matching.
- Click to add a new node mapping. Existing Node Mappings can be deleted by clicking the .
- Nodes can be selected by clicking the both for the Origin and for the Redirect sites.
- Select a default action for unresolved nodes from the drop-down menu.
- Click to create (or update) the Site Redirect or button to cancel all the changes.
- 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.
- Redirects can be deleted by clicking the 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.



