# cnBolt-Extensions-Redirector Allows editors to manage redirects and aliases inside the bolt cms. The redirects can be prvided as regular expressions and to internal redirects or external with 301 or 302 codes. ## Installation This extension is hosted in a private git repository and has to be installed manually. 1.) Edit your extensions/composer.json file and add the **cnd-redirector** repository: ``` "repositories": { "packagist": false, "bolt": { "type": "composer", "url": "https://extensions.bolt.cm/satis/" }, "cnd-redirector": { "type": "git", "url": "https://github.com/CondeNastDigital/cnBolt-Extensions-Redirector.git" } }, ``` 2.) Change to the extensions folder and install via composer. ``` composer require cnd/redirector ``` Installing or updating via the Bolt admin interface is also possible but would require the web-server's user to have proper access to the GitHup repository. This is usually not the case. ## Configuration The extension adds several new permissions to the system, which need to be added to your roles. The sample configuration shown here adds all permissions to **admin** and **developer** and some of them also to a new **seo** role. ``` permissions: # All roles for this extension roles: seo: description: This user can edit redirects. label: Seo Admin # All permissions for this extension and which role has them global: redirector:create: [ seo, admin, developer ] # Create new redirects redirector:read: [ seo, admin, developer, chief-editor, editor ] # See redirects redirector:update: [ seo, admin, developer ] # Update existing redirects redirector:delete: [ seo, admin, developer ] # Delete existing redirects redirector:testall: [ admin, developer ] # Test all active redirects (Server load!) ``` ## Usage The admin GUI for the redirector extension can be found in **Bolt's Extend Menu**. You can manage your redirects from there. A redirect consists of these fields: - Alias - the regular expression to match (ex: `/test/(max|sam)/page[s]*`) - target - the url to redirect to - Type - the type of redirection to perform. Either internal without changing the url or external with a status code - Active - Only redirects wich are marked as active will work - Comment - A text field for your documentation purposes