Hi,
I've got domain access running on a site which works great generally, the only problem I have arises with the menu links. Set up is as follows:

2 seperate domain access sites - each with it's own menu.
Shared content linked to the menu, with relative links (i.e. node/29)

Problem: Let's say I'm on Site B, but I click a menu item pointing to a shared node, I get redirected to SiteA/node/29 - but it should be going to SiteB/node/29

Whereas if I'm on Site A already, I will get sent to SiteA/node/29 which is correct in this case.

So, it seems to be selecting the domain in order of weight where it comes to the menu links rather than the current domain, which would be the preferred behaviour. Any ideas how to correct this please?

Comments

agentrickard’s picture

Use Domain Source (provided) to set the canonical link domain for each node.

agentrickard’s picture

Without Domain Source, you should be able to enable "Search engine optimization" and then set "Default source domain " to "Do not change domains."

Rhicreate’s picture

Thanks for your answers, actually in this case, it works better for me to have Domain Source turned OFF completely (I didn't realise that was the part of the module responsible for it until your post though, so thanks anyway!) It was the canonical links that were responsible for the domain switching actually, I want them to look and act like 2 seperate sites, so they have different themes, making the switch very obvious, not great for the user.
I will just start using absolute URLs if I want my user to be able to navigate between the sites.

agentrickard’s picture

Status: Active » Closed (works as designed)

That's certainly safer, yes.

Nicolas Bouteille’s picture

Version: 7.x-3.4 » 7.x-3.10
Component: Miscellaneous » - Domain Source
Issue summary: View changes
Status: Closed (works as designed) » Active

Hi,

I am having the same problem. I have a main site A and a sub-site B. The sub-site B has its own sub-theme, thus its own regions, and it has its own menu.
I create nodes that I only publish to site B and that I add to site B's menu.

When I am on site B and I have a look at site B's menu items, their path is siteA/path instead of siteB/path. In other words, all links go to siteA even though the node is only published on siteB.

In order to solve this, I have enabled Domain Source, so I now select siteB as source domain on each node. But it did not solve the problem.

Maybe this is due to the fact that I create new nodes from the siteA's admin ? I mean the Domain configuration is set so that I cannot administrer siteB at all. Everything is done from main siteA.

Thank you in advance

Nick

agentrickard’s picture

"Maybe this is due to the fact that I create new nodes from the siteA's admin ? I mean the Domain configuration is set so that I cannot administrer siteB at all. Everything is done from main siteA"

If you are creating nodes from SiteA and do not have permission to assign them to SiteB, then they will be auto-assigned to SiteA and the links will point there.

Nicolas Bouteille’s picture

I actually realized that the reason why I am creating nodes only from site A is because my Admin Menu links also point to site A even when I am on site B. So I can actually create nodes from site B if I want to. I actually tried too but it did not change the result.

I am logged in as user 1 so I have enough permission. I check site B at node creation and the proof that nodes correctly get assigned to site B is I can anonymously view them from site B but not from site A. Which is the expected behavior. But the menu links always point to site A although they are not even published there...

For now I have hard coded the absolute url from the menu admin directly... but this cannot stay like this.

Nicolas Bouteille’s picture

It might help to know that I use Domain Variable and Domain Theme. I don't use Domain Configuration, Domain Settings or Domain Navigation...

agentrickard’s picture

It actually sounds as if you might have $base_url hardcoded in settings.php. Admin links should always be relative to the active domain request. If you hardcode $base_url, that behavior breaks.

Nicolas Bouteille’s picture

I just rechecked but $base_url is not set in settings.php.
I remember this being one of the installation instructions to follow for Domain Access to work.
I confirm that all admin links on site B/admin point to site A. Not just Admin Menu's.

Nicolas Bouteille’s picture

Status: Active » Closed (won't fix)

Ok I found where the problem came from.
The site is bilingual English and French, and we are using different domains for language selection instead of language prefixes, ex: www.english-example.com and www.french-example.com instead of www.example.com/en and www.example.com/fr

Such a configuration is not compatible with Domain Access yet for two reasons:
- first, as I just witnessed, it overrides all links with the current language's domain address no matter which domain you're on. So, if I am on test.english-example.com, all links will still point to www.english-example.com. This should probably be fixed in Domain Access, but on the other hand, using domain for language detection probably isn't the best approach...
- second, when you use different domains for language detection with Domain Access, you need to specify one domain address per domain per language. So in the language settings, you need to be able to specify one domain address per domain. This is not possible yet because the language domain address field is not a variable.

So in the end, if you want to use Domain Access, don't use language detection via domain address but via prefix. That's what we're gonna do in our case.

In other words, one cannot have www.french-example.com and www.english-example.com as primary domain and then hope to have test.french-example.com and test.english-example.com as a sub-domain. This needs to be www.example.com/fr and www.example.com/en and then test.example.com/fr and test.example/en.