【发布时间】:2018-01-28 21:52:59
【问题描述】:
我对 mod_rewrite 一无所知,所以我很乐意得到任何帮助。我只想让 Apache 根据检测到的国家语言重定向我的主页。我的 PHP 正在自动翻译多种语言,并且由于 SEO,我试图避免将相同的站点与子域和域相乘 - 但看起来 Google 还没有那么先进,别无选择。
例如
mysite.com to:
mysite.com/index.php?lang=nl for holland
mysite.com/index.php?lang=fr for france
and for no specified country code just to:
mysite.com/index.php?lang=be
mysite.com/?lang=nl wwould also be fine
我也很乐意听到更好的建议。 我尝试了以下没有成功
RewriteCond %{HTTP:Accept-Language} ^nl[NC]
RewriteRule ^index\.html /index\.php?lang=nl [QSA,NC,L]
RewriteCond %{HTTP:Accept-Language} ^fr[NC]
RewriteRule ^index\.html /index\.php?lang=fr [QSA,NC,L]
我刚刚收到服务器错误 - 找不到可以帮助的确切案例
【问题讨论】:
标签: .htaccess redirect mod-rewrite seo translation