2

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

  1. I've created both subdomains to point to /www/dev/ folder.
  2. I've put settings.php in drupal1.example.com and default.settings.php in drupal2.example.com
  3. 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!

6
  • If you want to keep the name of your site private, I suggest that you check your post again :)
    – user7667
    Commented Jul 17, 2012 at 19:24
  • Pointing /www/dev/sites/drupal1.example.com to /www/dev/ sounds dodgy.
    – user7667
    Commented Jul 17, 2012 at 19:28
  • @coleopterist - have you ever been on example.com ? :o)
    – Axel
    Commented Jul 17, 2012 at 19:30
  • @coleopterist I want both subdomains to point to Drupal's root installation folder (/www/dev/) so that Drupal spits out the right sites (in the sites/ folder) for the right subdomain.
    – Axel
    Commented Jul 17, 2012 at 19:32
  • My bad - I thought you were symbolic linking them; and I was talking about itx-****.com. You missed a spot.
    – user7667
    Commented Jul 17, 2012 at 19:35

2 Answers 2

1

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.

1
  • Thanks! I've disabled the clean URLs in the default installation and have uncommented the lines : # RewriteCond %{REQUEST_FILENAME} !-f # RewriteCond %{REQUEST_FILENAME} !-d # RewriteCond %{REQUEST_URI} !=/favicon.ico # RewriteRule ^ index.php [L] But now I'm getting a 403 Forbidden error to access "/install.php" .. any thoughts ?
    – Axel
    Commented Jul 17, 2012 at 19:49
0

If you are on a shared host and have installed Drupal through a Script check if install.php is in the document root.

If not, download Drupal, extract install.php and put it in the document root. Now go to the site and the installer should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.