Thanks for putting together this great module. I was previously using some ugly custom code to get the same functionality and I like this approach much better. Unfortunately, I've encountered a problem.

My site is at example.com. It has a taxonomy vocabulary called section with the following terms: main, a, and b. I would like nodes in section a to map to a.example.com/node/xxxx and nodes in section b to map to b.example.com/node/xxxx. However, I would like nodes in section main to map to example.com/node/xxxx, not to main.example.com/node/xxxx.

This is how I configured subdomain:

Create subdomains for: Taxonomy vocabulary and associated content
With the selected vocabulary's terms: Section
Using: the name of the taxonomy term
disallow the following subdomains: main

In my pathauto configuration, I set the Node path settings to [subdomain]/node/[nid].

Everything is working great, but when I create a node in section main, the alias points to
main.example.com/node/xxxx instead of example.com/node/xxxx. Is this incorrect behavior? What should I expect to happen if pathauto tries to create an alias to a disallowed subdomain?

Comments

fossie’s picture

Do you have a workaround for this behavior?

I'm facing the same 'ignore' with the www. It seems that I can't use: www.mydomain.com it points to mydomain.com/~www

TIA,
Fossie

Super G’s picture

Here's the change that gets the behavior I want, but I'm not sure if it's the behavior that the module's creators had in mind.

189c189
<               if ($term_name) {
---
>               if ($term_name && !subdomain_reserved($term_name)) {
setvik’s picture

Status: Active » Needs review

Super G. Thanks for the patch! I haven't had a chance to test it yet, but it looks right. If anyone else can test and confirm it works, post a reply... otherwise i should have a chance to take a look at it in a couple of weeks.

setvik’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.