Core-Redirects is a CoreMedia extension for managing redirects from within CoreMedia Studio. The project is Apache-2.0 licensed, so it can be easily used and modified.
Features:
- Static redirects from an absolute url or a regular expression
- Conditional redirects: redirect only, if:
- the original page returns a 404
- the source contains certain url parameters
- Features can be activated for members of certain coreMedia groups.
- Import of redirects from a CSV file
- Optimized caching in the CAE to minimize response times
- Configuration of redirects per site
Per default, requests can only be redirected to a CoreMedia content. Redirects to external Urls can be done in two ways:
- linking a document of the type
CMExternalLink
- using targetUrls for certain redirects, instead of linking contents. This should be used with care, because it might redirect to a non-existing page. The nice thing about linking contents is that the redirect target will exist as long as the redirect exists.
See the releases for tested compatibilities. For earlier versions, have a look into these branches:
- CoreMedia 9 (v18.10). See the branch: 1904.2-compatible.
There is a simple user guide available.
You can integrate the extension in two ways:
1. Git SubModule
Add this repo or your fork (recommended) as a Git Submodule to your existing CoreMedia Blueprint-Workspace in the extensions-folder. This way, you will be able to merge new commits made in this repo back to your fork.
This is the recommended approach because you will also be able to develop quickly, performing a make on the sources with a running studio- or cae-webapp.
2. Copy files
Download the repo and copy the files into your Blueprint-Workspace Extension-Folder. This way you won't be able to merge new commits made in this repo back to yours. But if you do not like Git Submodules, you don't have to deal with them.
-
Change the groupId and versionID of all pom.xml to your project values.
-
The schema.xml (this link only works, if this code is within a blueprint workspace) of the content config-set must contain these two fields:
<field name="source" type="string" indexed="true" stored="true"/>
<field name="sourceUrlType" type="string" indexed="true" stored="true"/>
-
Redirects are stored in/read from a site-specific folder (
Options/Settings/Redirects
), to which users need to have permissions to edit and publish Redirect documents.
These options can be configured:
core.redirects.filter.keepParams
if enabled, the query params of the source url will be appended to the redirect target url.core.redirects.path
the site-relative path where the redirect-documents are storedcore.redirects.cache.parallel.site.recompute.threads
Maximum number of threads for complete site index updates. Will be used at CAE startUp.core.redirects.cache.parallel.item.recompute.threads
Maximum number of threads for item (single redirect) updates. Will be used for changes in a running CAE.core.redirects.permissions.targetUrlGroup
The group which allows members to describe a redirect target with an url instead of a document. Should be used with care. Use "*" to allow this for editor.core.redirects.permissions.regexGroup
The group which allows members to use the sourceType "regexp". Should be used with care.
That's it. Have fun ;) If you have any problems, questions, ideas, or feedback please contact us or create an issue.