Remap manager
The remap manager lists the current remaps (301 redirects) in the system and allows you to manage this list. It is located under the system management folder in the asset tree.
Details screen
The Details screen of the remap manager allows you to view the list of the current remaps in the system, delete and add remaps, and set a system-wide 404 Page not found asset.
Remaps in the remap manager are HTTP 301 moved permanently redirects. |
404 Page not found remappings
This section allows you to select the asset, which will be displayed for all sites in the system when the user enters an incorrect URL. This is set as a global default and will be used for any sites that don’t have a custom Page not found asset set on the site asset.
You can override which asset to use for the Page not found for each site asset in the system. Read the Core assets documentation for more information on how to do this.
Remapped URLs
This section lists all of the current remaps in the system and lets you filter the list of displayed remaps.
By default, Matrix automatically creates a remap when you change the URLs of an asset or move an asset. You can also create a remap when you delete an asset or use the fields available in the Add new URL remappings section of this screen.
For each remap listed in the remaps table, the following information is shown:
- Original URL
-
This shows the old URL of the asset. When users enter this URL, they will be taken to the URL listed in the Remap URL field.
- Remap URL
-
This shows the new URL. The user will be redirected to this remap URL if they enter the URL listed in the URL field.
- Expires
-
The date the remap will expire and be removed from the system. Expired remaps are automatically removed by the scheduled jobs manager.
- Method
-
The method of how the remap was created. The possible methods are:
- Automatic
-
The remap was automatically created by matrix when an asset was moved, deleted, or had its URLs changed.
- Documentation
-
The remap was added by a user, either on the Web paths screen of an asset or through the remap manager.
- CSV
-
The remap was added through a CSV file upload on the remap manager.
- Trigger
-
The remap was created by a trigger.
- Delete
-
Select this checkbox to delete the remap from the system after saving the screen.
- Never delete
-
Select this to lock the remap from deletion. If selected, this entry will be unable to be deleted until this option is cleared. You can use the remap filters section to filter the list of remaps in the table. Enter some filtering options and save the screen to see a new list of remaps based on your entered filters.
Click the Download file button; the file will be downloaded as a .CSV
file to your computer.
You can use the bulk delete remaps field to either delete all remaps in the system or just the filtered ones. Note that remaps set to never delete will not be deleted by this bulk delete action.
Add new URL remappings
The add new URL remappings section allows you to add new remaps to the system.
By default, if you move the asset or change its URL, Matrix will automatically create a remap. |
To add a new remap, fill out the following fields:
- Old URL
-
Enter the URL that you want to be remapped.
- New URL
-
Enter the new URL that the user will be redirected to when they enter the old URL.
- Delete old URL remap?
-
Select this if you want to remove an existing old URL remap to add the new one. This option is applied to both single or CSV upload file remap addition.
- Never delete
-
Select this to lock the entry from deletion. If selected, this entry will be unable to be deleted until this option is cleared.
- Expires
-
Enter the number of days that you want the remap to exist. If you leave this field blank, the remap will never expire. Alternatively, if you have several remaps to create, you can create a CSV file and import it. Each line in the file should contain four fields.
-
The old URL.
-
The new URL.
-
The expiry date (using the format
yyyy-mm-dd hh:mm:ss
). If you do not want to specify an expiry date, leave this field blank. -
The Never delete option (either 0 or 1).
-
If you have selected to import remap information through an uploaded CSV file, enabling the Column headings in CSV file? field will indicate to Matrix that the CSV file being uploaded contains column headers.
When this field is enabled, these column header values will be ignored, allowing the system to correctly import the remap information in the CSV file.
Remap rules
Remap rules allows you to use PCRE pattern matching to apply remaps within {matrix). This is useful when you want to redirect all pages under a website URL or a section of the site to a new domain or URLs section. Standard PCRE functions and delimiters are supported.
To add a new remap rule, click on the Add remap rule button. A new row will be added to the table where the following fields are available:
- ID
-
This is the automatically assigned identification number for the remap rule. This will be present in the response header of the 301 redirect that Matrix sends out so that you can quickly identify which remap in Matrix is causing the redirect on the frontend. For example, if the ID is
3
, the header will look like this:Matrix-remap-ID: 3
- Remap from
-
Enter a pattern to match URLs you want to be remapped.
- Remap to
-
Enter a pattern to replace the part of the URL matched by the Remap from value.
- Description
-
Enter a description of the purpose of the remap rule. This does not affect functionality and exists purely for ease of maintenance.
- Enabled
-
Enables you to enable or disable the remap rule.
- Delete
-
Delete the remap rule from the table completely.
- Reorder
-
Allows you to reorder the remap rules by dragging and dropping the row to a different location. The remap rules will be evaluated in a top-to-bottom order in the table. Matrix will evaluate these remap rules after all other possible remaps.
Remap rules always preserve the scheme portion of the URL (HTTP:// or HTTPS://), so you should always omit it from both the remap from or remap to patterns.
If you wanted to redirect all pages under matrix-documentations.squiz.net to matrix.squiz.net/documentations (preserving the relative URL path), you could create a remap rule entry with the following options:
Remap from: |matrix-documentations.squiz.net|
Remap to: Matrix.squiz.net/documentations
Remapping options
This section allows you to control whether Matrix will automatically create a remap when the URL of an asset is changed. You are also able to configure the Never delete value for newly added remaps.
The fields available in this section are as follows:
- Automatically add remaps when webpath changed?
-
Select whether remaps will be automatically added when the URL of an asset changes. By default, when the URL of an asset is changed (for example, when an asset is moved), a remap will be created. To stop this from happening, clear this option. This setting can also be configured on an asset per asset basis on the Web paths screen. For more information, refer to the asset screens documentation.
- Automatic remaps expiry time
-
Enter the duration (in seconds) of how long to keep automatically added remaps. Only applicable if Automatically add remaps when webpath changed? is enabled. Leave empty to never delete automatic remaps.
- Never delete added remaps?
-
Select whether remaps will be created as deletable or not. By default, added remaps are created as never deleted and locked from deletion until this option is cleared. To have remaps added as deletable (Never delete disabled), clear this option.
- Preserve query string in remaps?
-
Select whether a query string appended to a URL should be preserved when applying a remap. By default, query strings will be preserved on remaps, except where a trailing question mark (
?
) is appended to the end of the URL. For example, if the remap rule is that/foo
redirects to/bar
, enabling this option means that the URL/foo?sq_design_name=print
would remap to/bar?sq_design_name=print
. If this option was disabled, the remap would not preserve the query string and would redirect to/bar
.