"Redirect Loop" when creating a multisite I know there are a few questions related to this one, yet I haven't been able to answer mine.

I want to develop 2 websites pointing to the same Drupal core files,

so :

drupal1.example.com should point /www/dev/sites/drupal1.example.com drupal2.example.com should point to /www/dev/sites/drupal2.example.com


I've created both subdomains to point to /www/dev/ folder.
I've put settings.php in drupal1.example.com and default.settings.php in drupal2.example.com
When I load drupal2.example.com, I get a "Redirect Loop" error.


Do you know what I'm doing wrong ?

Thanks!

ANSWER :

When there was no settings.php file in my sites/drupal2.example.com folder, it showed the drupal1.example.com website.

When there was a settings.php file in my sites/drupal2.example.com folder, it got me an infinite loop.

So I modified the settings.php in sites/drupal2.example.com folder to connect to a different empty databse, but then I got an error "Base table or view not found: 1146" then another error upon refresh "error: Class 'SelectQueryExtender' not found".

It seemed as though the installer had a hard time loading the 2nd instance of Drupal since there were no tables in the DB.

So I imported DB #1 into DB #2 and it worked.  I could change the theme in drupal2.example.com and I still had the old theme in drupal1.example.com.

The only downside is that I have to delete the content types, nodes, menus, etc ... in my drupal2 but I least it's working!
Assuming you have ServerName and ServerAlias properly defined in Apache, I suspect you have the default canonical URL redirects enabled in your .htaccess.  Make sure this stuff is all commented out:

  # 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/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [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 the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]


Also make sure you don't have any other Apache rules that are doing something similar, and that you don't have any modules (eg, Domain Access or Mobile Tools) or custom code that would do a redirect.