The redirect is created without the i18n path prefix, such that the original URL still doesn't work (the original URL sans the prefix redirects, but this is of little practical use).
As an example:
1. I have the page /en/blog/my-first-blog
2. I rename it to "welcome to my blog"
3. A new alias /en/blog/welcome-to-my-blog is created
4. A redirect from /blog/my-first-blog -> /en/blog/welcome-to-my-blog
A user who bookmarked the original alias now gets a 404 when visiting the old alias at /en/blog/my-first-blog
The correct behavior is for step 4 to instead redirect from /en/blog/my-first-blog -> /en/blog/welcome-to-my-blog (note the addition of the /en/ prefix).
I have observed this behavior on Drupal 5 + i18n module, as well as Drupal 6 with the core translation module enabled. The attached patch is for Drupal 5 - I will attach a Drupal 6 soon (need to switch clients).
We are using the drupal_get_path_alias() function here, because that captures the prefixing (without testing and using custom_url_rewrite() directly, which is long-winded and adds no value). We cannot use the higher level url() because it applies the base_url, which we don't want, and also URL encodes it.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 365292.patch | 745 bytes | owen barton |
Comments
Comment #1
gregglesSounds great - Patch?
Comment #2
owen barton commentedPatch? What patch...
Comment #3
kehan commentedsubscribing
Comment #4
dave reidActually, now that I have multilingual support build in path_redirect, all we need to add is
$save['language'] = $language;. This change really should also be rolled into #365992: Update integration with path_redirect as well, so I'm going to mark this as a duplicate.