The front page claims...

Filters out existing pages so they won't be redirected (unless overridden)

... but the module fails to back off for paths that have been explicitly redirected using Redirect.

CommentFileSizeAuthor
#12 defer_to_redirect_module.jpg16.43 KBhargobind
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

stlnyc’s picture

Yes, we are experiencing the same dilemma. We would like to have 1:1 redirect rules defined in the Redirect module to process first...and then any pattern based rules defined inside Match Redirect next. Anyone have any thoughts on how to modify the priority of execution?

nsciacca’s picture

Set the module weight in the "system" table for match_redirect to be "1" instead of 0. This makes sure its hooks run after the "redirect" module and should preserve your 1:1 redirects before matching patterns.

biff45452’s picture

@nsciacca is correct. Whichever module runs first will win.

biff45452’s picture

Status: Active » Closed (works as designed)
demonde’s picture

Category: Bug report » Feature request
demonde’s picture

Match redirect should have an option to decide if match redirect or redirect runs first.

Hacking the DB is not a real option.

demonde’s picture

Status: Closed (works as designed) » Active
liannario’s picture

This would be a very nice feature to have

codevoice’s picture

Just in case it saves someone two minutes...

Set the weight for match_redirect to 1:

UPDATE `system` SET `weight` = '1' WHERE `system`.`name` = 'match_redirect';

Set it back to 0:

UPDATE `system` SET `weight` = '0' WHERE `system`.`name` = 'match_redirect';

demonde’s picture

I think it would be sufficient to put the weight to 1 in the installation process.

It is just logical that redirect patterns are less important than individual redirects.

Fuction for match_redirect.install would be:

<?php
/**
 * Implements hook_enable()
 */
function match_redirect_enable() {
    db_update('system')
    ->fields(array('weight' => 1))
    ->condition('type', 'module')
    ->condition('name', 'match_redirect')
    ->execute();
}
?>

hargobind made their first commit to this issue’s fork.

hargobind’s picture

StatusFileSize
new16.43 KB

New fork which adds a setting on the Match Redirects page to first defer to any redirects set up via the redirect module.

hargobind’s picture

Status: Active » Needs review