I have an old url with path :
http://seasecret.biz/he/החנות-שלנו

That I want to redirect to a new path alias :
http://seasecret.biz/he/חנות/בגדי-ים-צנועים

I have done the redirection for only hebrew language, but I soon as I click on the old URL I have an error 404.

Regards

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

redben’s picture

Subscribe, having the same problem.

FWIW, i have pathauto 1.3, subpath auto and global redirects enabled

greggles’s picture

Title: No success to redirect » Some redirects don't work with subpath alias installed
Category: support » bug
Status: Active » Needs review

I'm not sure how to fix this yet, but I found this behavior:

0. Install path_redirect
1. Create a node called "original node" with the alias "original-node" and another called "monkey pants" and the path "monkey-pants"
2. Create redirect from original-node/monkeypants to the path "monkey-pants"
3. Test the redirect, it works
4. Install url_alter, subpath_alias modules.
5. The redirect no longer works because "original-node/monkeypants" is expanded to "node/1/monkeypants" before path_redirect_get_path sees it.

I looked in $_SERVER and found QUERY_STRING which is q=original-node/monkeypants and therefore can be str_replaced to get the original request.

I could also see creating an implementation of hook_url_alter_inbound that stores the $path and $path_language in a static var so that path_redirect can find them later.

greggles’s picture

greggles’s picture

Updated patch after the previous had problems with trailing slashes.

greggles’s picture

Yet another patch - we should strip the querystring from these.

greggles’s picture

Wrong order of trimming query string and trailing slash...

Dave Reid’s picture

Testing should work now...

zilverdistel’s picture

For my website this wasn't enough, I also had to apply the patch at http://drupal.org/node/346911#comment-2392744, concerning the Global Redirect module.

jsobiecki’s picture

Patch from #6 works for me. Thanks!

greggles’s picture

Reroll for offset. Still applies, still works.

szy’s picture

Status: Needs work » Needs review

It still works with today's dev (2013-May-25).

(and the problem with Subpath still persists).

Thank you for the patch!

Szy.

Status: Needs review » Needs work

The last submitted patch, 744730_subpath_alias_compat_5-D6.patch, failed testing.

mdupont’s picture

Status: Needs review » Needs work

FYI Patch in #10 fixed the subpath / redirect conflict caused by path_alias_xt module, so it's not a fix specific to subpath alias.