我有3个域名的3次登陆,
所以我想:
.com
打开index.html
,
.se
打开index_sw.html
,
.es
打开index_es.html
这就是我的尝试:
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ index.html [NC,QSA]
RewriteCond %{HTTP_HOST} ^www\.domain\.se [NC]
RewriteRule ^(.*)$ index_sw.html [NC,QSA]
RewriteCond %{HTTP_HOST} ^www\.domain\.es [NC]
RewriteRule ^(.*)$ index_es.html [NC,QSA]
但它们都在解析index.html
,
知道我错过了什么吗?
- 编辑 -
尝试:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ index.html [NC,QSA]
RewriteCond %{HTTP_HOST} ^www\.domain\.se [NC]
RewriteRule ^(.*)$ index_sw.html [NC,QSA]
RewriteCond %{HTTP_HOST} ^www\.domain\.es [NC]
RewriteRule ^(.*)$ index_es.html [NC,QSA]
但仍然看到index.html
- 编辑 -
Also tried with:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^ /index.html [L]
RewriteCond %{HTTP_HOST} ^www\.domain\.se$ [NC]
RewriteRule ^ /index_sw.html [L]
RewriteCond %{HTTP_HOST} ^www\.domain\.es$ [NC]
RewriteRule ^ /index_es.html [L]
同样的结果......
答案 0 :(得分:1)
在DOCUMENT_ROOT/.htaccess
文件中试用此代码:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^ /index.html [L]
RewriteCond %{HTTP_HOST} ^www\.domain\.se$ [NC]
RewriteRule ^ /index_sw.html [L]
RewriteCond %{HTTP_HOST} ^www\.domain\.es$ [NC]
RewriteRule ^ /index_es.html [L]