Disallowed subdomains ignored

Super G - November 17, 2008 - 05:28
Project:Subdomain
Version:6.x-1.4
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:fixed
Description

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?

#1

fossie - December 11, 2008 - 15:03

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

#2

Super G - December 15, 2008 - 17:46

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)) {

#3

setvik - January 15, 2009 - 03:56
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.

#4

setvik - December 23, 2009 - 01:46
Status:needs review» fixed

Committed.

 
 

Drupal is a registered trademark of Dries Buytaert.