I have a site where there are several domains each with different content:


I want to make the alias foobar to different paths on each domain

www.domaina.com/foobar => page/100/14
www.domainb.com/foobar => page/136/12
www.domainc.com/foobar => page/96/14

I would like to be able to create the aliases using tokens and pathauto in my own module. I've considered Domain Access, but I'm not sure this allows you to create different aliases per domain.

Can someone please confirm what the best approach would be?


It looks like I can use Domain Path and Domain Access, but looking at the source code of Domain Path, I'd have to add entries for each alias:

$domain = domain_get_domain();
$domain_id = $domain['domain_id'];
$record = array(
    'domain_id' => $domain_id,
    'source' => "node/$node->nid",
    'alias' => $path,
    'language' => isset($node->language) ? $node->language : LANGUAGE_NONE,
    'entity_type' => 'node',
    'entity_id' => $node->nid,
drupal_write_record('domain_path', $record);

This is drupal 6 code, so I don't understand why there is an entity_type and an entity_id. I'm going to be creating aliases to sources that are views with arguments. Does anyone know how I'd create that record?

  • Talked to the module author. Entity information is optional. Adding an alias manually this way should work.
    – Arosboro
    Aug 29, 2011 at 18:06

1 Answer 1


Domain Access does allow you to have per-domain auto alias settings (but I have never tried this), but I am only seeing one alias on an edit page.

A less than idea option if you are using Panels is to have a panel page for each path, and then create a selection rule for each domain, and then assign the node that way. This would be a lot more work, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.