0
我有一個網站與子域。Htaccess爲多個網站codeigniter
我試圖搜索谷歌,但仍然沒有與我的項目合作。
我的結構文件夾是:
-public_html
--subdomain_folder (this is codeigniter)
---htaccess_for_subdomain
--domain_folder (this is my own projects website)
---htaccess_for_domain
--htaccess_for_root
下面
是我的htaccess代碼:
htaccess_for_root(的public_html)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.go.id$
RewriteRule ^(.*)/^(.*)/files/source/(.*)\.(gif|jpg|png|jpeg|css|js|swf|JPG)$ files/source/$2.$3 [QSA]
RewriteCond %{REQUEST_URI} !^/domain_folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /domain_folder/$1
# Change yourdomain.com to be your primary domain again.
# Change 'subfolder' to be the folder you will use for your primary domain
# followed by/then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?domain.go.id$
RewriteRule ^(/)?$ domain_folder/index.php [L]
****這是我的htaccess_for_domain *** *
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/files/source/(.*)\.(gif|jpg|png|jpeg|css|js|swf|JPG)$ files/source/$2.$3 [QSA]
RewriteBase /web/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /domain_folder/index.php [L]
這htaccess_for_subdomain
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index.php/(.*)$ /$1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
當我進入我的子域(www.sub.domain.go.id)它總是不正確重定向。
,我想的是,當我訪問www.domain.go.id它會重定向到domain_folder,當我訪問www.sub.domain.go.id,它會重定向到subdomain_folder
感謝