Closed (fixed)
Project:
Path redirect
Version:
6.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2009 at 07:18 UTC
Updated:
24 Jan 2011 at 13:35 UTC
I have a multilingual website with drupal 6. path redirect does not redirect path(s) which only include for example "?id=5". i checked the source code and realized that the problem is because of the following code :
<?php
$args[':path_query'] = $_GET['q'] .'?'. $path['query'];
?>
I removed $_GET['q']. and the problem fixed.
<?php
$args[':path_query'] = '?'. $path['query'];
?>
I don't understand the usage of $args[':path_query'] = $_GET['q'] . since i don't have any problem after applying this patch.
Comments
Comment #1
dave reidYou should not be removing $_GET['q']. So make sure I'm understanding correctly. You want to redirect from http://yourdrupalsite.com/?id=5 to another page?
Comment #2
sinasalek commentedUnfortunately it dos not without removing it. and yes you got it right
From: ?article_id=1
To: fa/node/1027
Comment #3
dave reidIf you remove the $_GET['q'] and you have that redirect you want set, if I go to http://yoursite.com/please-do-not-redirect-me?article_id=1 it will still redirect me. I have a solution I'm working on that will involve you creating a redirect using From: ?article_id=1
Comment #4
sinasalek commentedYou're right i just tested it.
Sure, let me know if you did any progress.
Thanks
Comment #5
dave reidOn second thought I'm not sure this is a redirect appropriate for the module since you're operating on an existing path (). This would probably be best implemented in .htaccess. Although we will be adding 'forced redirect' support in #615008: "Forced" path redirect - override the existing path or alias. You will find with the latest commits that you can perform a redirection on '?id=3' now.
Comment #6
sinasalek commentedThanks Dave,
Comment #7
mshaver commentedI'm trying to redirect from a previous wordpress site with permalinks set to non-clean like so "blog/?p=123". I have the latest dev release of path_redirect and I've turned off the blog modules, but I just get a page not found 404 when I type in the above url. It sounded like from your comment above that redirects from query stings like this was possible with the latest dev releases? Am I doing something wrong?
Thanks for any insight!
Comment #9
yan commentedHas this really been fixed? I'm using 6.x-1.0-beta7 but when I try to redirect from
http://example.com/?page_id=1306to an internal page, the question mark (?) is stripped and the redirect is created as
http://example.com/page_id=1306This redirect is created, though, but it doesn't work:
http://example.com/test/?page_id=1306Comment #10
dave reidYou need to use From:
<front>?page_id=1306Comment #11
yan commentedGreat, thanks!
Comment #13
antiorario commentedSorry to open old threads, but is this feature present in RC2? If it is, maybe I'm doing something wrong. Thanks.
Comment #14
antiorario commentedNever mind. Not sure what I did or didn't do, but it started working.