Is there a method to catch all the redirections on my site that contains an certain path on drupal level? I want to change the domain of those to an external URL.

For example when there is animal in the path it should link to an external URL: www.example.com/animal?small=frog => www.example2.com/animal?small=frog.

  • You can use Match Redirect module for redirection of url. – amruta.k Apr 7 '16 at 11:12
  • I'm not sure if you can redirect to a external domain with that module. Also I'm using drupal 8 so unfortunately it won't work anyway. – Stack Apr 7 '16 at 11:22
  • I would look into using a RouteSubscriber to alter or add routes based on the path, and then the route can do a Redirect. That's probably what Match Redirect will need to do in Drupal 8. – mradcliffe Apr 7 '16 at 11:58
  • That's pretty much what the Drupal 8 patch to Match Redirect does: drupal.org/node/2478179 – mradcliffe Apr 7 '16 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.