Please note I removed this step 2 from the options I otherwise detailed, in the 'multiple sites' version of this document (scroll to the bottom): http://drupal.org/node/47163
If you would like me add/clarify this to the mulitple-sites docs (linked 2nd, this message), tell me so, be patient, and I'll get it done. I'll do it, but I struggle getting my head 'round with this RewriteBase stuff, so please be patient. In the meantime, maybe the first link in this message will help you.
Step 2 is similar to what I have in mind: in both cases, Drupal is installed in a subdirectory and can be accessed as a subdirectory. And symlinks are involved in both cases. But I expect the methods diverge from that point.
I like your naming scheme, though. How would you name this method?
Here's a rough sketch of the method I've been using:
Install Drupal into a subdirectory, ./drupal-1. (Subsequent code bases can be installed into ./drupal-2, ./drupal-3, etc.)
Make a symlink to the active Drupal subdirectory, ./drupal-active -> ./drupal-1.
Edit $base_url in settings.php to include the subdirectory, http://www.example.com/drupal-1.
Edit the RewriteBase in .htaccess in the subdirectory.
Edit .htaccess in the parent directory so that it internally redirects to the active Drupal subdirectory, ./drupal-active. The address in the visitor's browser never changes.
Add a line to the index.php in each subdirectory to reset $base_path. This makes all rendered links point back to the parent directory, which is what the visitor expects.
There is a catch: If two Drupal installs are active at once (e.g. under A/B testing conditions), the page cache keys will be the same since this method mangles the $base_path. Two small tweaks to page caching functions work around this problem. But the method would be more palatable without the tweaks.
So with the following directory structure (and some other preparation), the Drupal installed in ./drupal-1 looks to the visitor like it is installed in the parent directory.
Comments
Comment #1
amstercadPlease refer to step two in this page: (http://drupal.org/node/26434). Is this what you had in mind?
Please note I removed this step 2 from the options I otherwise detailed, in the 'multiple sites' version of this document (scroll to the bottom): http://drupal.org/node/47163
If you would like me add/clarify this to the mulitple-sites docs (linked 2nd, this message), tell me so, be patient, and I'll get it done. I'll do it, but I struggle getting my head 'round with this RewriteBase stuff, so please be patient. In the meantime, maybe the first link in this message will help you.
Comment #2
njivy commentedStep 2 is similar to what I have in mind: in both cases, Drupal is installed in a subdirectory and can be accessed as a subdirectory. And symlinks are involved in both cases. But I expect the methods diverge from that point.
I like your naming scheme, though. How would you name this method?
Here's a rough sketch of the method I've been using:
./drupal-1. (Subsequent code bases can be installed into./drupal-2,./drupal-3, etc.)./drupal-active -> ./drupal-1.$base_urlinsettings.phpto include the subdirectory,http://www.example.com/drupal-1.RewriteBasein.htaccessin the subdirectory..htaccessin the parent directory so that it internally redirects to the active Drupal subdirectory,./drupal-active. The address in the visitor's browser never changes.index.phpin each subdirectory to reset$base_path. This makes all rendered links point back to the parent directory, which is what the visitor expects.There is a catch: If two Drupal installs are active at once (e.g. under A/B testing conditions), the page cache keys will be the same since this method mangles the
$base_path. Two small tweaks to page caching functions work around this problem. But the method would be more palatable without the tweaks.So with the following directory structure (and some other preparation), the Drupal installed in
./drupal-1looks to the visitor like it is installed in the parent directory.Would you like me to continue sketching the method here for you to document?
Comment #3
njivy commentedIf the contents of
settings.phpare the only difference between two code bases, this method makes further use of symlinks. For example,Comment #4
emmajane commentedUnder: http://drupal.org/upgrade/tutorial-introduction there is a section on http://drupal.org/upgrade/preparing-the-site which includes information on safely upgrading a site.