Domanda

Sorry about my english level.

I researched so much, and i found that can i use ".htaccess" to get redirection to subdomain folder and this is OK.

In Drupal i need to create a folder for each subdomain in "/sites/sub.example.com/" and copy "default.settings.php" from default folder "/sites/default/default.setting.php" and rename it to "settings.php", after that, enable "$databases" variable in the same file, when it's done, i need to add a wildcard and modify "hosts" file.

Well, i should "automate" all this, but i don't know if it's is more hard because it's important hold the server safety with writing permissions or try another way, someone could advise me.

Im working on OSX and Drupal 7.x (recent release)

Thank you very much.

È stato utile?

Soluzione

For each site that you want to use separate database, create own sites/ directory with settings.php. For example, if you want to have one database for example.com, another one for sub1.example.com and third one for sub2.example.com, all using same code base, setup your files like this:

sites/example.com/settings.php

sites/sub1.example.com/settings.php

sites/sub2.example.com/settings.php

each settings.php using different database credentials. Read more here - https://drupal.org/documentation/install/multi-site

Also, if you want to automate this and if there is supposed to be bigger number of sites to be managed, consider deploying aegir - http://www.aegirproject.org.

I hope I understood your question correctly.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top