Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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

www.domaina.com
www.domainb.com  
www.domainc.com

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?

UPDATE:

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?

share|improve this question
    
Talked to the module author. Entity information is optional. Adding an alias manually this way should work. –  Arosboro Aug 29 '11 at 18:06

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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