虛擬主機-多域名多目錄使用方法

根目錄文件修改:

文件名:.htaccess

添加內容:

  1. <IfModule mod_rewrite.c> 
  2. # 關閉目錄列表 
  3. Options -Indexes 
  4. RewriteEngine on 
  5. # 預設頁面 
  6. DirectoryIndex default.html index.html default.html index.htm default.php index.php 
  7. # vlina.com跳轉到www.vlina.com 
  8. RewriteCond %{HTTP_HOST} ^vlina.com [NC] 
  9. RewriteRule ^(.*)$ http://www.vlina.com/$1 [L,R=301] 
  10.  
  11.  
  12. # 綁定域名www.vlina.com綁定到shop目錄下
  13. RewriteCond %{HTTP_HOST} ^(www.)?vlina\.com$ [NC] 
  14. RewriteRule ^(.*)$ /shop/$1 [L] 
  15. </IfModule> 

目錄名:shop

添加文件:.htaccess

添加內容:

 

  1. <IfModule mod_rewrite.c> 
  2. RewriteEngine on 
  3. RewriteBase /shop/ 
  4. </IfModule> 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章