Is there not a risk with these modules that you could end up getting penalized from having duplicate content? Even if its not duplicate, is it not diluting content?

Skirt.com seems ok at a glance as it appears most content is posted to just 1 of the subdomains, however if you were to post something to more than 1 then you either have the same content on two different domains (and these are INTENTIONALLY different, not just a site with and without 'www.') or alternatively you have 2 different landing pages for SE's to target. If ten people were to write blog entries and 50% pointed their links at one site and 50% at another then you are seriously diluting incoming links.

I REALLY like the concept of these modules but I just have a few alarm bells going in my head about them right now... I quite like my sites appearing in google ;-)

Comments

agentrickard’s picture

This is potentially an issue, but it has more to do with how the module is implemented than the module itself.

I'm open to using this thread to explore options for mitigating this problem. Perhaps force the SiteMap to one site.

nicholasthompson’s picture

I suppose you might WANT a node to appear on site A, B and C so that you might get the branding effects, etc...

With your modules can you specify a "parent" or "source" site? Sort of like a default... For example, I can see on skirt.com that you can access node 20 like this..
http://sdfiluhflsjdf.skirt.com/node/20

You can also access it via the houston site and I assume others too...

Is your module aware if the current subdomain exists or not? If it is aware and the subdomain doesn't exist, can it redirect to a parent or default site (usually www. I'd imagine)...

All this redirection is fine, however if you ARE on node/20 on the houston site then you likely GOT THERE from the houston site. Therefore you cannot set one node to be the default because you'd break the history (ie, someone would jump from Houston to Memphis or something).

Is there some kind of HTML element which you can use to make a page "claim" its source as another? This way when Google visits it can see that although houston.skirt.com is hosting node/20, its actually blah.skirt.com which is the REAL host and deserves all the credit.

I do entirely agree that its not the modules fault that a site could be penalised for dupe content, however I think its something authors should be made aware of.

For example, someone could maliciously release a page on their site pointing to hundreds of random sub-domains (but same node) of a site running these modules and all of a sudden Google and Co will see hundreds of pages with unique URL's (allbeit same actual DOMAIN) but the same content. I'd like the think most modern SE's are intelligent enough to figure this out - but you can never be too sure!

agentrickard’s picture

Really what you want are teaser pages, views, and the like that share elements across different affiliates. Some other answers below.

With your modules can you specify a "parent" or "source" site? Sort of like a default...

No. I was actually just thinking about this. With the new hook_url_alter() [patch required], we can force this behavior: Select the first match in the domain list and send all links to that domain. This might be made an optional setting for people worried about SEO. Take a look at domain_url_alter() and you can see how this would work.

Is your module aware if the current subdomain exists or not? If it is aware and the subdomain doesn't exist, can it redirect to a parent or default site (usually www. I'd imagine)...

In the versions released on Drupal.org, yes. You cannot navigate to an "unregistered" domain. Skirt still runs on alpha software -- not the beta release candidate.

Is there some kind of HTML element which you can use to make a page "claim" its source as another? This way when Google visits it can see that although houston.skirt.com is hosting node/20, its actually blah.skirt.com which is the REAL host and deserves all the credit.

I don't know. I'd love it if you could answer that question.

someone could maliciously release a page on their site pointing to hundreds of random sub-domains

This can't happen in the version released through drupal.org. Take a look at domain_init() and the 'valid' flag.

agentrickard’s picture

Category: support » feature
Status: Active » Needs review

I think that the hook_url_alter() function will solve most of this issue.

For testing, change line 951 of domain.module:

  // This routine only needs to be run from certain urls.
  $check = domain_grant_all();
  if ($check) {
    // Check to see if this is a node or comment link and set $nid accordingly.
    // We static the $nid results to make this more efficient.

To:

  // This routine only needs to be run from certain urls.
  $check = domain_grant_all();
  if ($check || TRUE) {
    // Check to see if this is a node or comment link and set $nid accordingly.
    // We static the $nid results to make this more efficient.

In the release version, I'll change that TRUE to a setting option.

agentrickard’s picture

Working in DEV. Will commit to HEAD later today. Here's the behavior:

-- If SEO settings are turned on, all node links are rewritten as absolute URLs.
-- If the node is assigned to 'all affiliates' the link goes to the root domain.
-- If the node is assigned to a single affiliate, the link goes to that affiliate.
-- If the node is assigned to multiple affiliates, the link goes to the first matching domain.

By default, this behavior is turned off.

nicholasthompson’s picture

Category: feature » support
Status: Needs review » Active

That sounds very sensible Ken... Nice work!

Suggestion for future... For Multiple Affiliates, could a node have a default affiliate associated? So (IIRC from your Barcelona talk) you have a column of tickboxes for the affiliates... What if there was also a column of radio buttons too so you could select a default affiliate rather than simply the "first" (likely to be the one beginning with "a")?

This is a module I'm keeping a careful eye on as I have a few idea's brewing in my head which this module would make SO easy (idea's are rather like Skirt in terms of location based websites sharing data, but would be a completely different area in terms of content).

agentrickard’s picture

You probably could add this feature, but for most uses it is really overkill.

Perhaps the domain sorting function could be used here as well.

agentrickard’s picture

Status: Active » Fixed

Committed to HEAD. If we need more advanced functionality, let's open a new issue.

Anonymous’s picture

Rewritten node links are (currently on CVS) missing the slash after the domain name, so one.example.com/node/14 is coming out as one.example.comnode/14

agentrickard’s picture

Category: support » bug
Priority: Normal » Critical
Status: Fixed » Active

Really. That doesn't happen on my system. Some questions:

-- Are you using clean urls?

-- Are you running Drupal in a subfolder?

Anonymous’s picture

Really. That doesn't happen on my system. Some questions:

-- Are you using clean urls?

-- Are you running Drupal in a subfolder?

Clean URLS are on, plus pathauto. Drupal 5.3 recently installed, with a number of other modules, I haven't made changes to the directory structure at all, no symlinks or other changes either. All of my modules have been added to the modules/ default (as in, not under sites/all/modules or anything).

In my settings.php I do have base_url set, otherwise there are problems with theme styles:

$base_url = 'http://example.com';  // NO trailing slash!

db_prefix is also set, because I was originally going to use the array for subdomains, left it because it hasn't seemed any different.

$db_prefix = 'main_';

For Apache, my mod_rewrite rules are in httpd.conf (I don't use .htaccess) for example.com (well *.example.com really) as:

	RewriteCond  %{REQUEST_FILENAME} !^/$
	RewriteCond  %{REQUEST_FILENAME} !^/(files|misc|uploads)(/.*)?
	RewriteCond  %{REQUEST_FILENAME} !\.(php|ico|png|jpg|gif|css|js|html?)(\W.*)?
	RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

I ran into the problem yesterday when I tried the CVS version of domain + the Drupal core patches it comes with. Changing line 987 of domain.module to something like this works, but I've just turned off the SEO friendly rewriting for now. This change isn't on my server atm, but yeah the simple change worked when I tried it:

          $path = $domain[$nid]['path'] . "/" . $path;

Perhaps a simple check for whether the trailing slash on the domain is present or not and add it accordingly? I don't think I have anything strange in my setup.

agentrickard’s picture

That check happens in the function below, which may need some alteration.

Can you try editing this on your install?

/**
 * Determine an absolute path for a domain
 *
 * @param $domain
 *  The currently active $domain array, provided by domain_lookup().
 *
 * @ingroup domain 
 */
function domain_get_path($domain) {
  global $base_url;
  $_url = parse_url($base_url);
  // If in a subfolder, the web server needs the trailing slash.
  (!empty($_url['path'])) ? $_path = $_url['path'] .'/' : $_path = $_url['path'];
  $path = $domain['scheme'] .'://'. $domain['subdomain'] . $_path;
  return $path;
}

I'm testing with subfolders, so it may be that $_path _always_ needs the trailing slash, or that the !empty check is not sufficient.

Anonymous’s picture

I think I may see the problem. Within that function, you're doing a test whether in a subfolder, but since you're parsing $base_url, it will always test as empty, because the $base_url is set as http://example.com

I'm not sure what the proper variable is to check for what the link's full url should be, but I assume that's what needs to be tested against instead. I'll figure that out shortly and post back here.

agentrickard’s picture

Well, in a subfolder installation, $base_url returns: example.com/folder

So I was checking for that and adding a '/'

On my test machine, I run in a subfolder and do not set $base_url manually.

global $base_url;
print $base_url;

Returns:

http://example.com/drupal-5.3

So 'path' tests as TRUE in my usage.

print_r(parse_url($base_url));

Returns:

Array ( [scheme] => http [host] => example.com [path] => /drupal-5.3 )

Testing some alternative code now.

agentrickard’s picture

Perhaps this is the right answer:

function domain_get_path($domain) {
  global $base_url;
  $_url = parse_url($base_url);
  // If in a subfolder, the web server needs the trailing slash.
  if (empty($_url['path'])) {
    $_path = '/';
  }
  else {
    $_path = $_url['path'] .'/';
  }
  $path = $domain['scheme'] .'://'. $domain['subdomain'] . $_path;
  return $path;
}
Anonymous’s picture

That seems to be working for me.

agentrickard’s picture

Status: Active » Fixed

Marking as fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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