Hi,

I am wanting to redirect all of retail-shops/* to grocery-shops/*
e.g.
retail-shops/canada
to
grocery-shops/canada

I was expecting that this module would have that capability since it used a wildcard.
Is this possible with this module?

Regards
Geoff

Comments

biff45452’s picture

Not at this time but I have plans to make it possible to do this:

Source:
retail-shops/*

Target:
grocery-shops/%1

UksusoFF’s picture

Issue summary: View changes

Any solution for this?

paul2’s picture

Yes, that's what I was expecting this module to do as well, I'm surprised it's not supported yet. Guess I'll find something else.

ar-jan’s picture

This would be very useful. +1.

beauKC’s picture

Agreed. Kind of assumed that's what this module did. Not particularly useful without this feature, to be honest. +1

adam_b’s picture

Yes, please. +1

alexanansi’s picture

I assumed that was what this module did too. At least describe the module better because there are obviously lots of other people getting confused about this +1

salvis’s picture

Same here. As long as we're not able to pick up the tail of the path we can't do much more than redirecting to an error page.

Also #2502707: Match Redirect overrides Redirect, which makes this even worse, essentially making Match Redirect unusable.

RStrydom’s picture

StatusFileSize
new630 bytes

I just came across the same module and expected the same functionality. I already changed my pathauto pattern and regenerated all the aliases, so I desperately needed this functionality. I quickly made a patch which worked for my specific sitiuation. Do not use this patch without understanding it's limitations. Basically it just takes the begining part of the pattern (before the '*') and concatinates it with the last part (after the '*') of the target URL.

for e.g.:

Setting:
Pattern - alias/*
Target - new-alias/subpath/*

Test:
Test URL - alias/node-title
Result URL - new-alias/subpath/node-title

As I said I needed it so this is a really ugly solution, but I hope it helps someone and can help move this forward to getting this as a full fledged feature.

luison’s picture

#9 works great!! Dont know why is this option in the module... with that I was able to redirect taxonomy in users to a view of users with that taxonomy and without disabling the taxonomy view!!! ^_^

sirtet’s picture

@RStrydom in comment #9:

Do not use this patch without understanding it's limitations

I don't see what the limitations of the approach used could be.
Can someone elaborate?

RStrydom’s picture

@sirtet

The limitation is that is pure concatination of the two strings. So you won't be able to replace a value that is sitting between two static path values. For eg. path/to/*/content/ etc.

On a side note I did this in a rush so knowing that one is generating a lot of aliases, I didn't want anyone to accidentally mess it up.

philosurfer’s picture

# 9 worked great!

humansky’s picture

Status: Active » Reviewed & tested by the community

#9 works like a charm

nwom’s picture

Here is a re-rolled patch against the newest dev, since patches always need to be applied to dev releases rather than stable versions. Thanks for your work on this. Please review.

nwom’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
ejrasmus’s picture

Here is the same patch from #16 with a check to see if there is also a wildcard in the Target URL as suggested in #18.

dsim’s picture

Here is the patch which embeds the query parametes in the target url if target url does not have query params.

dsim’s picture

Attaching a patch which supports case insensitive urls.

khalor’s picture

Status: Needs review » Needs work

This only works if the wildcard is at the end of the URL... wouldn't work if the URL to redirect from was group/*/invite for example.
I'm using the following, but it only works for single-character wildcards - needs some logic to detect length of the replaced wildcard:

$redirect = substr($redirect, 0, $wildcardPos) . substr($current_alias, $wildcardPos, 1) . substr($redirect, $wildcardPos + 1);
ndf’s picture

This is a re-roll of #9 against current --dev version.

doteagle’s picture

Status: Needs work » Needs review

Tried patch and worked as intended.

Anonymous’s picture

Patch 23 worked for me.

jfarry’s picture

Status: Needs review » Reviewed & tested by the community

Not sure on the requirements for RTBC but I've just tested this and it's working great for me too :)

ndf’s picture

Changes of #20 and #21 then should go to separate issues.

lwalley’s picture

Separate patch for #21 case insensitive match is available at #2948710: Case insensitive matches #3.