2013-12-17 117 views
1

我有3個着陸3個域,重寫域靜態HTML頁面

所以我想:

.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,

任何想法我錯過了什麼?

CNC中

嘗試:

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

CNC中

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] 

相同的結果...

回答

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] 
+0

現在,所有文件都在/ www中,是否有錯? –

+0

'/ www'是你的'DocumentRoot'嗎? – anubhava

+0

我可以在FTP中看到完整路徑: '/ home/user/website/www/.htacess' –