Closed (outdated)
Project:
Domain Path
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2012 at 03:27 UTC
Updated:
16 Dec 2025 at 23:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardPerfectly valid but perhaps tricky to implement.
Comment #2
agentrickardThis is a duplicate of #1310628: Integration with pathauto -- auto generate different url alias for different domains
Comment #3
ron williams commentedHi agentrickard,
I think this may be a different, yet related, issue to the one you linked. In #1310628: Integration with pathauto -- auto generate different url alias for different domains the user is looking to generate multiple aliases based on patterns for each domain. For example:
In my use case I would want to:
In this case, the requirement for a domain specific pathauto pattern is not necessary; however, auto assignment for the single domain is necessary.
Feel free to mark as duplicate if this feature is too related to the other issue even with this difference.
Comment #4
ron williams commentedComment #5
agentrickardI see. That is different.
Any idea how you want to configure those rules?
Comment #6
ron williams commentedFor my use case, I would suggest using the built in pathauto patterns while only setting the domain path for the current domain.
Comment #7
grndlvl commentedHere is some preliminary code I am working on to generate the path automatically for the source domain if the pathauto path already exists for the current node.
This only takes into account for the source domain and must run before domain_path's validate.
Instead of forcing the domain_source when using DOMAIN_SOURCE_USE_ACTIVE you could check for DOMAIN_SOURCE_USE_ACTIVE and load the current domain and set it that way. The other stuff was already in my system because of the specific use case.
Most of this code comes from pathauto_create_alias() http://drupalcontrib.org/api/drupal/contributions!pathauto!pathauto.inc/...
Comment #8
grndlvl commentedI think in order to do this we will need to require the domain_source module.
Comment #9
riho commentedAny movement on this issue? This seems like a popular feature request and it's something that seems to come out of the box with most CMS-s I've worked with, but is giving me quite a headache in Drupal. Seems hard to belive that noone hasn't had the need to solve it so far.
Comment #10
agentrickard@riho
Really? Context-specific URL aliases (e.g. multiple aliases for a single page) is an out-of-the-box feature? I don't think so.
I think you are confusing this feature with PathAuto module.
Comment #11
riho commentedThe out of the box feature I meant is the ability to use the same alias for different nodes on different domains. Like the case Ron Williams described above:
Indeed, I understand that Domain Path is not exactly designed with that in mind, but whenever this issue has risen on the forums they get closed down with the link to this module and I have not found a further debate on it so far.
But let me try to visualize a use case. Let's say I have set up Domain Access for a blog site with hundreds of users and each user gets his own domain, but has no access to others data. Now the user shouldn't even have to think about SEO paths, he'll just enter his blog entry and the path gets generated in the background. Let's say John and Peter both post on their blogs with the title "First post". Is there really any sensible reason why john.blog.com/first-post and peter.blog.com/first-post couldn't exist?
If this case is better solved with giving PathAuto some support for Domain Access, fine by me, but from what I've gathered, Domain Path is the only existing module that even remotely addresses this issue.
Comment #12
agentrickardNo, this is one of the scenarios that Domain Path _is_ intended to represent.
This issue is about automating those aliases -- which is not a simple task, partly due to how PathAuto is written, and partly due to the overhead involved in generating. This issue is the proper place to work on automated, multi-domain paths. Patches and reviews are welcome.
What I take issue with is your blatantly false assertion that "other CMSes" do this natively. They do not. In fact, none of the major CMSes even support a Domain Access model.
Raising that point derails work on this issue and is patronizing (if not insulting) to those working on it. Dredging up forum posts is irrelevant. We've already identified this as a need -- that's why there is a feature request for it.
Please be more considerate in the future.
Comment #13
riho commentedI really appreciate your work on Domain Access and it's modules. I had no intention of derailing the project or insulting anyone and I'm sorry if I came across that way. But I also have not claimed that all other CMSes have this feature, I only spoke from the experience of the ones I've worked with, which also means that this is something most my clients are used to and expect to get.
I'm more than willing to hop on board and help to work on making this happen. All I needed was to be pointed at the right direction, since it wasn't clear to me where the problem lies or why anyone hasn't found the need to solve this so far.
Comment #14
grndlvl commentedLets wait until #1425292: domain_path_node_insert() should update existing records rather than deleting/recreating them is ready to go.
Comment #15
johnpitcairn commentedWatching. I have the same use-case as Ron in #3, for a couple of installations.
Comment #16
grndlvl commented#1425292: domain_path_node_insert() should update existing records rather than deleting/recreating them has been committed it's just waiting on tests. So this is ready to start.
Comment #17
grndlvl commentedMarked #1942708: Automatically create same alias for different nodes as a dupe.
Comment #18
buddaJust what we were looking for. Glad to see somebody else has been discussing it for a while.
Comment #19
budda@agentrickard is there any scope for potentially financial sponsorship of this feature request maybe ?
Comment #20
agentrickardTime is the issue more than money, for me at least.
See also #1412938: Allow domain path-auto support.
Comment #21
buddaSee also #1412938: Allow domain path-auto support. <- that's this ticket. Was there another node intended?
Comment #22
agentrickardhttps://drupal.org/node/1310628
Comment #23
scotthorn commentedI have a very limited solution working right now in an external module that could potentially be expanded. It's working at the moment for my limited use case, but I could imagine several potential conflicts that I'm not checking for right now and that I think I can avoid through permissions. Thought I'd post this in case it helps someone.
It uses pathauto to generate the path, adds a second checkbox to the path settings section of a node edit page for generating the url based on domains selected to publish, and then during hook_node_presave, if the node is published to all domains it lets pathauto generate a regular core path, but if only specific domains are selected, it fills in the value with pathauto's generation and lets domain_path save it during its hook_node_insert.
It required the module's hook to run after pathauto, so I made a .install file to lower my module's weight.
Comment #24
scotthorn commentedI realized after posting I neglected to add the line that makes it only set to domains that are published.
The full hook_node_presave function should actually then be
Comment #25
xaqroxThanks @scotthorn, that stuff is an excellent starting place. Here are a couple more moves to make, as far as Pathauto-like behavior is concerned:
domain_pathaliases auto-generated, with no regular alias, on save you are redirected to the system path (e.g.node/12345, not thedomain_pathalias.TRUE. Pathauto has a whole table,pathauto_stateto store whether or not a given entity has an auto-generated alias, data from which is used to populate the option, seepathauto_entity_load()inpathauto.module(line 344 in version 7.x-1.3)I'm working on this for a client with a tight timeline; hopefully I'll have time to make a patch that integrates #23 and #24 with this stuff, but if not maybe someone else could pick up where I left off ;)
Comment #26
jlpena123 commentedDo we have solution in this issue already? I'm using Drupal 8 and I'm in the same situation with #3.
Comment #27
kumkum29 commentedHello,
i have the same problem. On several domains I have the same node title (same menu structure). After having set the patterns of pathauto, I get the alias for all my nodes But if the alias already exists i get a number at the end of the alias, e.g:
Node 1 on domain 1:
presentation
Node 2 on domain 2:
presentation-0
Node 3 on domain 3:
presentation-1
...
Is there a solution to create the same alias on all the domains ? I want to get "/presentation" for all domains.
I don't see how to proceed, because Domain Access module use an unique site, and unique pathauto settings...
I have seen the Domain Path module, but it focuse on the same node.
Thanks for your help.
I'm on D8.
Comment #28
steveoriolHello kumkum29,
Have you find a solution ? I have the same problem...
Comment #29
kumkum29 commentedBonjour Stève,
I haven't found a solution to resolve this specific case.
For the moment, I add an unique string/ID at the end of the alias (i.e. nid).
Example: www.mysite.com/mypage/125
Comment #30
steveoriolThank you kumkum29,


but your solution doesn't works for me.
The "Domain Path" module works after all caches reseted.
I have:
and
and after drush cr
I can switch from :
https://domain1.com/fr/contact
to
https://domain2.com/fr/contact
C'est cool !
Comment #31
mably commentedAn experimental module as been provided for more recent Drupal versions.