For every node created in the default language, I'd like pathauto to create two identical aliases, one in the default language and a language neutral one. So far I've found no way to do this. Am I missing something?

Comments

greggles’s picture

Unfortunately I'm not sure if this is possible nor how to do this. Can you explain a bit more why you want to do this and what steps you follow and which urls you want to be aliased in what ways? Giving a full set of instructions like:

1. set content translation settings like X
2. create a node in language Z
3. the paths foo and bar exist but I want them to be aliased like baz and boop

Would help.

mike_r1977’s picture

First of all, thank you greggles for your reply. I badly need help and am really grateful for your support.

My situation is this one: I have a language neutral site that I'm currently in the process of transforming into a multilanguage site with (so far) two languages, a default one and a secondary one.

In Administer › Site configuration › Languages under Language negotiation I have specified "Path prefix with language fallback".

Pathauto is set up this way:

Default path pattern (applies to all node types with blank patterns below):
[bookpath-raw]/[title-raw]

All the other Pathauto patterns are blank and the aliasing works like a charm.

Now if I create a new node in my default language, Pathauto creates the wonderful alias with the book hierarchy I wanted and sets the url language to my default language.

Supposing my default language is 'en', my book is 'book' and my node is 'my_node', I get the url alias "book/my_node/ with language specified as 'en', which results in:

en/book/my_node

when accessing the node. This is all wonderful, except that if I try to access: book/my_node I get a 404 error.

Instead I'd like to also have book/my_node direct to my new node, which, I think, is only possible if a language neutral alias is added besides the one with the language set.

Is this in any way possible?

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

If English is the default language, you should be able to access the path without the 'en/' prefix. Maybe this is a core bug? Can you try with the latest version (6.x-1.3)?

klonos’s picture

The prefix for the default language only shows if language negotiation is set to 'Path prefix with language fallback'. It should also do so for 'Path prefix only', but you are correct Dave, this is a core bug:

#244162: Links not rewritten to include prefixes with 'Path prefix only' language negotiation

dave reid’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Since there is nothing we can fix here, marking as a duplicate of #244162: Links not rewritten to include prefixes with 'Path prefix only' language negotiation