简体   繁体   English

将域重写为静态HTML页面

[英]Rewrite domains to static html pages

I have 3 landings for 3 domains, 我有3个域的3个着陆点,

So I want: 所以我想要:

.com to open index.html , .com打开index.html
.se to open index_sw.html , .se打开index_sw.html
.es to open index_es.html .es打开index_es.html

This is how I'm trying: 这就是我正在尝试的方法:

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] 

but they are all resolving index.html , 但它们都在解析index.html

Any idea what am I missing? 知道我想念什么吗?

-EDIT- -编辑-

Tried: 尝试:

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] 

But still seeing index.html 但仍然看到index.html

-EDIT- -编辑-

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] 

same result... 同样的结果

Try this code in in your DOCUMENT_ROOT/.htaccess file: 在您的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] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM