2

I have built a multilingual site in Joomla! 3.1.x Dutch and English, using the multilingual functions native to Joomla! 3.1.x. I have two domain names that I want to go to this site, one to the Dutch side, the other to the English side.

  1. http://www.internationalerozekerk.nl
  2. http://www.internationallgbtchurch.org

Number 1 should go to: index.php?lang=nl

Number 2 should go to: index.php?lang=en

In the .htaccess I have added this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^internationallgbtchurch.org [NC]
RewriteRule (.*) ^internationalerozekerk.nl/index.php?lang=en$1 [L,R=301]

This redirects the English URL to internationalerozekerk.nl/index.php?lang=en. However, the address bar still reads: internationalerozekerk.nl/index.php?lang=en and not internationallgbtchurch.org

I haven't found anything to make the two URLs stay in the address bar.

Any suggestions?

Thanx,

Thom

4

2 回答 2

0

您可以将这些规则用于内部重定向:

RewriteCond %{HTTP_HOST} ^(www\.)?internationallgbtchurch\.org$ [NC]
RewriteRule ^$ /index.php?lang=en [L,QSA]

RewriteCond %{HTTP_HOST} ^(www\.)?internationalerozekerk\.nl$ [NC]
RewriteRule ^$ /index.php?lang=nl [L,QSA]

参考:Apache mod_rewrite 简介

于 2013-10-14T17:18:58.887 回答
0

尝试删除主机名和R标志并删除$1.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^internationallgbtchurch.org [NC]
RewriteRule ^(.*)$ /index.php?lang=en [L,QSA]

对于其他网站:

RewriteCond %{HTTP_HOST} ^internationallgbtchurch.nl [NC]
RewriteRule ^(.*)$ /index.php?lang=nl [L,QSA]

在末尾添加$1请求 URI,这将完全弄乱查询字符串。如果您希望将路径作为另一个参数发送,那么您需要明确说明它(例如,“路径”):

RewriteCond %{HTTP_HOST} ^internationallgbtchurch.org [NC]
RewriteRule ^(.*)$ /index.php?lang=en&path=$1 [L,QSA]
于 2013-10-14T17:21:24.907 回答