When using the gsitemap module in a multi-site configuration, the master site works fine but the slave sites return a 302 (Moved Temporarily) error at Google when submitting the sitemap.

The problem stems from the fact that the Single Sign-On module redirects traffic to the master site to login.

Comments

zis’s picture

the same thing happens with feeds. The slave site feeds return errors in feedburner, google reader and most online feed parsers because of the redirect. There should be some kind of setting to disable single sign on for some pages..

druvision’s picture

Priority: Normal » Critical

The same happens for *any* URL on the subsites!
People can't surf my subsites!

I have installed singlesignon together with the 'multidomain' module.

Everything seems OK when I surf the sites from my desktop,
but my users can't see the sites.

To reproduce the error, all I need is to SSH to my server, and issue the following commend:

wget .

# wget directory.levavie.com

--13:25:41--  http://directory.levavie.com/
           => `index.html.1'
Resolving directory.levavie.com... done.
Connecting to directory.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302 
Location: http://www.levavie.comhttp://www.levavie.com/singlesignon/initial_check?slave_session=161be0cf4d4c465bb4d43bbb92d2dedc&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F [following]
http://www.levavie.comhttp://www.levavie.com/singlesignon/initial_check?slave_session=161be0cf4d4c465bb4d43bbb92d2dedc&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F: Bad port number.

It seems singlesignon_init is called TWICE.

druvision’s picture

Title: Single Sign-On + gsitemap = 302 (Moved Temporarily) error at Google » Single Sign-On gives 302 errors for all slave sites
druvision’s picture

I've tried to implement a temporary solution by deleting the duplicate url prefix inside the singlesignon_goto function:

function singlesignon_goto($uri) {
 $master_url = variable_get('singlesignon_master_url', '');

/* Delete duplicate URLs, if any */
if (substr_count ($uri, $master_url) > 1) {
     $uri = substr ($uri, strlen ($master_url));
}
/* End new code */

  header('Location: ' . str_replace(array("\r","\n"), '', $uri));
  exit;
}

but now I get a different error: 'redirection cycle detected'.

# wget http://directory.levavie.com
--14:54:35--  http://directory.levavie.com/
           => `index.html'
Resolving directory.levavie.com... done.
Connecting to directory.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302 
Location: http://www.levavie.com/singlesignon/initial_check?slave_session=f5f04e0e34f4af9954c57ff9a9ab882f&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F [following]
--14:54:36--  http://www.levavie.com/singlesignon/initial_check?slave_session=f5f04e0e34f4af9954c57ff9a9ab882f&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F
           => `initial_check?slave_session=f5f04e0e34f4af9954c57ff9a9ab882f&singlesignon_dest=http%3A%2F%2Fdirectory.levavie.com%2F'
Resolving www.levavie.com... done.
Connecting to www.levavie.com[209.59.178.5]:80... connected.
HTTP request sent, awaiting response... 302 
Location: http://directory.levavie.com/ [following]
http://directory.levavie.com/: Redirection cycle detected.
aspankie’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev

This was happening to me with feeds. Very frustrating! To fix, I just added:

  // If it's a request for a feed, do nothing
 if ($start=strpos($_SERVER['REQUEST_URI'], 'feed') || $start=strpos($_SERVER['REQUEST_URI'], 'rss.xml')) {
    return null;
  }

to the very top of singlesignon_init(). Hope this helps! Note: version 4.7

starkos’s picture

I have a fix for this; you can get it from my site (along with a brief explanation of the problem and the fix).

mlncn’s picture

Confirming and subscribing.

mlncn’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

Confirmed thin bug for both Drupal version 4.7 and version 5.

wayland76’s picture

Status: Active » Closed (duplicate)

This is a duplicate of http://drupal.org/node/170001