Does this allow redirection of

/comment/reply/* to /user/register

or something else

Comments

jwilson3’s picture

Title: Wildcard Redirection » Redirection with wildcards or regular expressions

We're migrating an old custom search system into Drupal views, and were wonder a similar thing:

Would be nifty if the module could handle something like:

oldurl/*/* => newurl?option1={1}&option2={2}

Currently, I'm thinking the only way I think this could be done is in a custom module with a menu callback handler that does the rewrite logic, or done at the server level (eg Apache's mod_rewrite).

jwilson3’s picture

UPDATE to comment #1:

It looks like the Panels module is capable of handling this functionality, using their "HTTP Response code" variant type with a 301 response code; you can setup arguments eg myurl/%placeholder1/%placeholder2, load contexts based on those arguments, and then use tokens from the arguments and contexts in the redirect URL. Finally, all this can be exported to code if you want.

Very cool indeed.

pere orga’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

There is a lot of interest in this feature apparently (I've seen 3 other very similar tickets), but that's very different to what Redirect module is doing. IMHO that's out of the scope of this module, At least for 1.x

I didn't know that Panels can do something like that. Otherwise it could be a good idea for a new contrib module (although things like this could be done in the web server too, e.g. via .htaccess)

pere orga’s picture