Unable to redirect paths which only include query string
sinasalek - November 4, 2009 - 07:18
| Project: | Path Redirect |
| Version: | 6.x-1.0-beta4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
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.

#1
You 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?
#2
Unfortunately it dos not without removing it. and yes you got it right
From: ?article_id=1
To: fa/node/1027
#3
If 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
#4
You're right i just tested it.
Sure, let me know if you did any progress.
Thanks
#5
On 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.
#6
Thanks Dave,
#7
I'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!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.