Active
Project:
Match Redirect
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2015 at 14:26 UTC
Updated:
29 Sep 2015 at 15:30 UTC
Jump to comment: Most recent
Hi, I'm trying to redirect an url to another url with a query string, but the '?' and '=' necessary comes out as %3F and %3D respective. Is there a way to enter a target path with a query string?
My example is:
pattern: ldview/all-categories/eat-drink/*login
target: user/login?destination=node/add/lowdown-eat-drink
This module is great - it solved a big problem for me! Many thanks!
Ulf
Comments
Comment #2
ulfaberg commentedHi again, I found a workaround editing the htaccess file (only works for Apache). The result I wanted in my request I got by adding the following line to the htaccess file around line 120 just after
#RewriteBase /, mysite being my site obviously:RewriteRule ^ldview/all-categories/eat-drink/(.*)login$ http://mysite/user/login?destination=node/add/lowdown-eat-drink [R=301,L]I thought I'll post it here in case it might benefit someone else with the same problem.
Comment #3
luison commentedI have resolved this issue with the code from:
https://www.drupal.org/node/2374157
In drupal/sites/all/modules/contrib/match_redirect/match_redirect.module...
// Do the redirect.
drupal_goto($redirect, array(), $code); //change this line to
$parsed_url = drupal_parse_url ( $redirect );
drupal_goto ( $parsed_url ['path'], array (
'query' => (! empty ( $parsed_url ['query'] ) ? $parsed_url ['query'] : array ())
), $code );