开发者

How to set up multiple sites using one database on Drupal 7?

Been round the web trying to sort this out, lots of info on pre D7 versions. but D7 just seems to point to the sites.php file.

I would like to have a "example.com" and "m.example.com" this would be for normal and mobile phone versions. at the moment I have this kind of structure.

local windows install using xampp.

  • c:\xampp\htdocs\example\all my Drupal site files
  • e.g.
  • c:\xampp\htdocs\example\sites\all\themes\example\
  • c:\xampp\htdocs\example\sites\all\modules\example\

My webserver

  • /public_html/all my Drupal site files
  • e.g.
  • /public_html/sites/all/themes/example/
  • /public_html/sites/all/modules/example/

this site all works by accessing www.example.com

so now Id like to create a new theme (and maybe new modules) to run for my subdomain www.m.example.com I setup my subdomain using CPanel and it created the m folder under /public_html/ e.g. /public_html/m

I'd like to configure a working setup for my local machine and a published website setup for the www.m.example.com site.

I've tried configuring the sites.php file but am co开发者_运维技巧nfused by the examples and its use.

So please if you could help me out here, that would be great.


What you want to do is change your structure a bit. The sites directory in Drupal can be used to house your various sites. As you would imagine, the "all" directory is a directory that would be shared between all instances. You should set up your sites and directories like this. drupal/sites/all drupal/sites/example.com drupal/sites/m.example.com In these directories, you can have site specific modules and themes, and settings.php. If you want the sites to use the same DB, just duplicate the settings.php into both sites folders. If needed you can use the sites.php to set up directory aliases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜