根目錄文件修改:
文件名:.htaccess
添加內容:
- <IfModule mod_rewrite.c>
- # 關閉目錄列表
- Options -Indexes
- RewriteEngine on
- # 預設頁面
- DirectoryIndex default.html index.html default.html index.htm default.php index.php
- # vlina.com跳轉到www.vlina.com
- RewriteCond %{HTTP_HOST} ^vlina.com [NC]
- RewriteRule ^(.*)$ http://www.vlina.com/$1 [L,R=301]
- # 綁定域名www.vlina.com綁定到shop目錄下
- RewriteCond %{HTTP_HOST} ^(www.)?vlina\.com$ [NC]
- RewriteRule ^(.*)$ /shop/$1 [L]
- </IfModule>
目錄名:shop
添加文件:.htaccess
添加內容:
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteBase /shop/
- </IfModule>