OK I have had a multi-site drupal install for a couple years now. The site config tells drupal which site to initialize. That's all easy. Now I have a site that needs SSL. I have to create a new instance in cpanel for that site so that it has a dedicated IP. I want to link to my same multi-site drupal though. So say I'm in /home/newsite/www/ and I want my index.php to initialize the drupal install at /home/drupal5/www/index.php. Is there a way I can do that? It's fine to have my ./files dir and my ./tmp directory at /home/newsite/www/ but all the drupal installation stuff would be at a different location.

I tried just creating a symlink at /home/newsite/www/index.php to /home/drupal5/www/index.php but it didn't work I think bc drupal is using relative paths. Maybe I need to change my include path? Thoughts? Is this a common issue with multi-site installs?

Comments

drupalninja99’s picture

I tried adding /home/drupal5/www/ to my include path to no avail

drupalninja99’s picture

<?php
define('INC', '/home/drupal5/www/');
ini_set('include_path', INC);
chdir(INC);
require INC.'index.php';
?>

This took me half way there, only issue is that the static content paths, like CSS and image links are wrong bc they're pointing back to /home/newsite/www/ instead of the /home/drupal5/www/

drupalninja99’s picture

I think I need some rewrite rule that incoming requests to https://www.shareddrupal5.. are rewritten to go to www.newsite or /home/drupal5/www/

drupalninja99’s picture

I see examples of modifying httpd.conf which I'm guessing means I have to reboot apache which I don't want to do. Can I accomplish virtual hosts via htaccess?

drupalninja99’s picture

I would just delete the public_html directory at /home/newsite/public_html (www is an alias) and create a symlink to point /home/newsite/public_html (or www) to /home/drupal5/www/ - won't that work? - dedicated IP shouldn't matter. It just acts like its in the file system? Sounds good to me!

I tried it and it seemed to work fine, haven't tried it with SSL - can't see why that wouldn't work.

drupalninja99’s picture

I have a 4.7 site at lets say example.com I want to park my new ssl site at example.com and do a rewrite rule to make newsite.com redirect to example.com/dev/ where dev is a symlink to my shared drupal install /home/drupal5/www/ -- how do I do that?

drupalninja99’s picture

I tried using the HTTP_HOST as a condition for RewriteBase to use the /dev subfolder which is a symlink to my multisite install of drupal but it didnt work.