[英]Microsoft Windows Server 2016: How can I switch domain names on click in a multi-language website?
我创建了一个多语言应用程序,我想将它托管在 IIS 服务器上。 我已经创建了 2 个网站(一个用于法语( frenchsite.com
和一个用于英语englishsite.com
)。现在,如果我在我的英语网站上点击法语,它如何将我重定向到我的法语域?
假设我在我的英文索引页面上:
englishsite.com/en/index.html
当我按下一个按钮时,它会将我重定向到我的法语网站:
frenchsite.com/fr/index.html
在 apache 上,我会使用配置文件执行此操作,但我不知道在哪里可以使用 IIS 找到这样的东西。
我正在使用 Microsoft Windows Server 2016
您能否告诉我们您使用了哪个 apache 设置来实现此要求?
在我看来,这可以通过使用标签或 js function 轻松实现。 If you use js function, you could bind a button onclick function to redirect to another IIS web sites.
细节,你可以参考下面的代码。
<a href="http://frenchsite.com/fr/index.html">French</a>
或者
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script>
function myFunction() {
location.href = "http://frenchsite.com/fr/index.html";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<a onclick="myFunction()">French</a>
</div>
</form>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.