lorenzo
lorenzo

Reputation: 187

Two Drupal installation on the same server

I installed Drupal 7 in the root folder of my server. Now I would like to install another Drupal 7 website in a subfolder (/test), but when I run the /test/install.php script, I get:

" To start over, you must empty your existing database. To install to a different database, edit the appropriate settings.php file in the sites folder. ... "

It seems that it is still loking at the database of the version in the root folder.

In /test/sites/default/config.php I set the new db.

I suspect that this is all related to .htacess and rewrite rules. Somebody can help?

thank you in advance!

Upvotes: 1

Views: 1966

Answers (2)

MER
MER

Reputation: 1561

I realize this post is old, however there is, in my opinion, a more thorough and lower risk option than creating a re-write rule to resolve this problem. The alternate option for this situation is to use a virtual host entry in your .htaccess file.

In order to do this properly you must create two virtual host entries. One entry for the original URL/Drupal 7 install (the one @ the site root). The second virtual host entry will be for a second URL which points to the Drupal 7 site in the subdirectory.

To do this correctly you must first enter the following line (or un-comment the line if it already exists):

NameVirtualHost *:80

Next you must create the two virtual host entries. One will be similar to the following:

<VirtualHost *:80>
ServerName your.url.fortheroot
ServerAlias alternate.url.fortheroot
DocumentRoot "/path/to/webroot"
</VirtualHost>

The next entry would be similar to the following

<VirtualHost *:80>
ServerName your.url.forthesubfoldertest
ServerAlias alternate.url.forthesubfolder
DocumentRoot "/path/to/webroot/test"
</VirtualHost>

If you do not use the virtual host method and you choose the rewrite method there is a possibility that you may need to modify the settings.php to reflect the correct base root of your Drupal 7 install for the one in the /test subdirectory. (try without but if you have problems with clicking on links giving you 404 errors then try with). NOTE: I still definitely recommend the virtual host path over the rewrite rule path.

Upvotes: 1

Will Tate
Will Tate

Reputation: 33509

I performed a similar operation by having a sub folder installation of Drupal I used for staging purposes.

I added the following to my .htaccess of the original drupal installation to tell it to ignore my subfolder. Otherwise the original installation will try to handle access to the subfolder installation.

#Place this right below RewriteEngine on
RewriteCond %{REQUEST_URI} "/test/"

Upvotes: 0

Related Questions