Ability to disable 293453: Wildcard DNS - default domain

Bèr Kessels - October 14, 2008 - 12:58
Project:Domain Access
Version:5.x-1.11
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

293453: Wildcard DNS - default domain introduced a rather ugly case: not being able to access one's test/devel domain.

We use OTAP, meaning different domains for development, testing, Acceoptance and Production. While on production the redirect introduced in #293453 may be good (arguable), for dev and test it certainly is not.

Issue #1: I was developing and chagning some settings in devel. but. without notice I was redirected to the LIVE site. So instead of disabling some module on test, I actually did that on live! My fault, I should havve taken notice of the addressbar, but being unaware of this feature, I did not know. Minor issue with a large impact.
Issue #2: No longer being able to change any settings on the devel site. I had to manually comment the drupal_goto in the source of domain module in order to disable the module alltogether on development urls.
issue #3: All urls, inclduding other-example.com/foo/bar lead to example.com. instead of example.com/foo/bar. Users who land on the wrong domain are always erdirected to the Homepage, not to the path they gave.

I would like to discuss a way to disable this feature alltogether. In all our cases we want, nor need this feature.
But I expect a toggel for this option to be a) a usability issue and b) a performace issue.

Thoughts?

#1

agentrickard - October 14, 2008 - 13:34
Status:active» needs review

Domain Alias fixes this problem but removing this behavior entirely and allowing redirects on a per-alias basis, but is currently for D6 and needs to be backported. (With domain_alias, you simply say "yes, redirect *.example.com to example.com unless it matches another registered domain.)

Making this a setting is fine by me -- though we have lots of settings already.

Line 57ff of domain.module would become something like so:

  // If return is -1, then the DNS didn't match anything, so use defaults.
  if ($_domain == -1) {
    $_domain = domain_default();
    // If the request was not for the primary domain, send the user there.  See http://drupal.org/node/293453 and http://drupal.org/node/321071.
    if (variable_get('domain_redirect_wildcards', FALSE) && !empty($_domain['subdomain']) && $_subdomain != $_domain['subdomain']) {

That patch should work for you right now.

#2

Bèr Kessels - November 10, 2008 - 14:35

Would

<?php
$options
= array('-1' => t('Do not change domain'));
?>
(line 281ff) not be best used for this?

Somehow it does not show up on my main site. Which makes me think that there is something else going wrong there.
I would expect t('Do not change domain') to be the setting that disabled automatic redirects.
If so, then I best change above code into

<?php
 
// If return is -1, then the DNS didn't match anything, so use defaults.
 
if ($_domain == -1) {
   
$_domain = domain_default();
   
// If the request was not for the primary domain, send the user there.  See <a href="http://drupal.org/node/293453" title="http://drupal.org/node/293453" rel="nofollow">http://drupal.org/node/293453</a> and <a href="http://drupal.org/node/321071.
" title="http://drupal.org/node/321071.
" rel="nofollow">http://drupal.org/node/321071.
</a>    if ((variable_get('domain_default_source', 0) != -1) && !empty($_domain['subdomain']) && $_subdomain != $_domain['subdomain']) {
?>

#3

Bèr Kessels - November 10, 2008 - 14:50

And abovementioned change in a patch.

AttachmentSize
32107_wildcard_dns_redirect_settings.patch 1.02 KB

#4

agentrickard - November 10, 2008 - 15:09

Possibly. I am deep in development on the D6 version, so this is not really getting my attention.

I don't think that is what 'default_domain_source' is designed for, so using it in that way may confuse people. That's why I think a separate setting is in order.

#5

Bèr Kessels - November 21, 2008 - 13:46

This patch contains the requested separate setting.

#6

Bèr Kessels - November 21, 2008 - 13:47

.. nope. this patch...

AttachmentSize
32107_wildcard_dns_redirect_settings_02.patch 2.52 KB

#7

agentrickard - June 28, 2009 - 16:19
Status:needs review» active

I will test this for D5, since I may need it now.

#8

agentrickard - June 28, 2009 - 20:23
Version:5.x-1.9» 5.x-1.11
Status:active» fixed

I have split this patch into two parts. One part controls the redirect setting. The other controls the display of the message indicating that a redirect has taken place.

Be default, both are set to TRUE, which is the current behavior.

AttachmentSize
321071-settings.patch 5.94 KB

#9

System Message - July 12, 2009 - 20:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.