Skip to content
Snippets Groups Projects
Forked from project / regex_redirect
6 commits behind the upstream repository.
user avatar
Issue #3127630 by DamienMcKenna: "Title" field is spelled wrong
Lara van Zuilen authored
8c718d50
History

#Regex Redirect 8.x-1.x

##CONTENTS OF THIS FILE

  • Description
  • Requirements
  • Installation
  • Configuration and use
  • Todo's

DESCRIPTION

The Regex Redirect module is a path management module for Drupal 8 and Drupal 9. It is an extension of the redirection API provided by the redirect module.

The primary use case for this module is to:

  • Create redirects which will redirect all URLs matching a specific pattern
  • View existing regex redirects in an admin view

The module itself may be found at regex_redirect Please report bugs in the issue queue.

REQUIREMENTS

This module requires the redirect module.

INSTALLATION

The module is installed is the regular manner.

CONFIGURATION AND USE

1. Enable to module at Administration > Extend
2. View the regex redirects at Administration > Configuration >
   Search and Metadata > Regex redirects
3. Create regex redirects by clicking "Add regex redirect". Set a title
   to recognize the redirect pattern by. The redirect source field should
   be a regular expression with named captures. The redirect path should
   contain the named capture variables. Also select the redirect status and
   language.

Examples:

Source Path
node\/(?P<id>[0-9\.]+) news/<id>
page\/(?P<id>[0-9\.]+)\/(?P<month>[a-z\-]+) event/<id>/date/<month>

TODO'S

  • Add a unit test for the RegexRedirectRequestSubscriber
  • Create kernel tests for RegexRedirect
  • Create WebTestBase tests for RegexRedirectForm