用一套Drupal程序搭建多站點非常方便,我們以前一般獨立站點都是用的2級、3級域名,例如:
- industry.bizdirlib.com
- ar.chn.youbianku.com
上面的設置比較簡單,最近搭建的一套多站點準備采用子目錄的形式,例如:
- industry.bizdirlib.com/sic01
- industry.bizdirlib.com/sic02
這種子目錄方式在設置中與前面說的子域名形式稍有不同,要點記錄如下:
-
子目錄設置:在drupal_root/sites下新建目錄,例如:
- drupal_root/sites/industry.bizdirlib.com.sic01
- drupal_root/sites/industry.bizdirlib.com.sic02
-
軟鍊接設置:在drupal_root下建立符号鍊接,例如:
- ln -s . sic01
- ln -s . sic02
- 簡潔網址設置:在drupal_root下的.htaccess中設置,例如:
# Options FollowSymLinks
RewriteEngine On
RewriteBase /
# AllowOverride All
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/sic01
RewriteRule ^(.*)$ sic01/index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/sic02
RewriteRule ^(.*)$ sic02/index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
這三步都設置正确後就OK了。
评论2
博主能具體介紹下Drupal平台上如何操作嗎
博主能具體介紹下Drupal平台上如何操作嗎
這些都是在設置期間在服務器上做的
上面說的這些都是在設置期間在服務器上做的,這些東西設置好了以後才能創建新的Drupal網站,并不是在設立好了Drupal網站後再在菜單中操作。
這些内容我是從Drupal官方網站上找到的一些文檔和問答,我寫得不具體,要詳細的資料你還可以在google中搜索,或者你看具體有什麼問題也可以留言我們探讨,謝謝!