I am using the subdomain module in organic groups mode. This works beautifully for creating subdomains for each group, however it's breaking the main site.

So for example group.mysite.com is working well but as soon as a group is created and subdomain generated, all pages on www.mysite.com are "page not found".

However, a node that was on www.mysite.com/node/1 can now be found on group.mysite.com/node/1. Even though the node is not part of that group and cannot be created into that group.

Very confusing. Any ideas please?

CommentFileSizeAuthor
#8 subdomain_broken_main_page.patch825 bytesdtrdewaele

Comments

Anonymous’s picture

Update: I have tested it in user subdomain mode and that breaks the site too. So admin.mysite.com works fine but the main site is broken.

What could I be doing wrong?

zazinteractive’s picture

I'm sure it's just the module

Anonymous’s picture

Maybe if I provide a bit more information it will help debug this issue:

Drupal 6.19
Subdomain 6.x-2.0-beta1 and have also tried the dev version with the same result

As per instructions I have done the following:

$cookie_domain = '.mysite.com';
Enable wildcard DNS on your DNS hosting provider
Configure your webserver for wildcard virtual hosts - *.mysite.com

No errors show up in the subdomain module configuration page. Nothing unusual or custom changes to my .htaccess file. No modules that should be interfering with this.

What's odd is that all the admin pages work fine - e.g. www.mysite.com/admin/content/node - it's just the main site URL is broken and all nodes now live under the subdomain.mysite.com URL.

Help!

Anonymous’s picture

Copy of .htaccess for good measure:


#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.90.2.5 2010/02/02 07:25:22 dries Exp $
strawman’s picture

did you ever get this solved..running into the same issue..homepage is not being found for the main site but subdomans works well...

If I go to the aliased home page "site.com/home" it works
But if I go to just "site.com" it shows page not found.

I've cleared caches and such plus made sure my site information had "node/1" as my home page but still nothing...

I also tried to change the default view in the subdomains settings to a custom view..upon doing that it makes my homepage show up but as the homepage to my first subdomain created...odd I must say...

Trying to sort out if anyone can give a hand on this that would be great.

Thanks

Anonymous’s picture

Unfortunately I still haven't had a resolution on this. It sounds like we have slightly different issues. The problem for me is that all the pages on the main site get mapped under the subdomain.

So my organic group "intranet" is supposed to live at http://intranet.mysite.com. The rest of the site lives at http://www.mysite.com.

When I enable the subdomain module for some reason it thinks all my site's main pages are supposed to be in that subdomain, so my main about page is now http://intranet.mysite.com/about instead of http://www.mysite.com/about. It's really weird.

strawman’s picture

Yeah, I had that initially as well..I managed to clear some of that up in the module but its still acting weird with the links depending on if i'm on a subdomain or not..

Really hoping to have some sort of fix for it...I fixed what I can so far and am still sorting it out myself but was hoping it could get solved without me hacking it apart to fix it....

dtrdewaele’s picture

StatusFileSize
new825 bytes

This patch fixes the thing. Also troubles with menu items are fixed with this.

dtrdewaele’s picture

Status: Active » Needs review
Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

The patch works!

As a side note, I couldn't get the subdomain to generate for my existing group, (even though it worked for new ones) so I just manually entered it into the 'subdomain' table in the database.

Thank you!

fotuzlab’s picture

Thanx coworks_dieter. patch in #8 worked for me perfectly :)

jvieille’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Good!
The patch is validated a long time ago, please commit!

jvieille’s picture

Many bug reports will vanish if this is committed
http://drupal.org/node/1216158
http://drupal.org/node/1100974
http://drupal.org/node/1798322

And probably some others

honza pobořil’s picture

Version: 6.x-2.0-beta1 » 6.x-2.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Postponed

Could you test it with 6.x-2.x-dev, please?