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

dave reid’s picture

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?

sinasalek’s picture

Unfortunately it dos not without removing it. and yes you got it right
From: ?article_id=1
To: fa/node/1027

dave reid’s picture

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

sinasalek’s picture

You're right i just tested it.
Sure, let me know if you did any progress.
Thanks

dave reid’s picture

Status: Active » Fixed

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.

sinasalek’s picture

Thanks Dave,

mshaver’s picture

Category: bug » support

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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

yan’s picture

Version: 6.x-1.0-beta4 » 6.x-1.0-beta7
Status: Closed (fixed) » Active

Has this really been fixed? I'm using 6.x-1.0-beta7 but when I try to redirect from

http://example.com/?page_id=1306

to an internal page, the question mark (?) is stripped and the redirect is created as

http://example.com/page_id=1306

This redirect is created, though, but it doesn't work:

http://example.com/test/?page_id=1306

dave reid’s picture

Status: Active » Fixed

You need to use From: <front>?page_id=1306

yan’s picture

Great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

antiorario’s picture

Version: 6.x-1.0-beta7 » 6.x-1.0-rc2

Sorry to open old threads, but is this feature present in RC2? If it is, maybe I'm doing something wrong. Thanks.

antiorario’s picture

Never mind. Not sure what I did or didn't do, but it started working.