Fra*_* H. 4 virtualhost serveralias apache-2.2
我有一个带有两个 VirtualHosts 的简单 apache2 设置。一种是带有“普通”字符的域名,一种带有外来字符(带有 punycode)。
问题是我不知道如何将“www”添加为 punycode 域的别名。使用“正常”的它工作正常。
这是“正常”主机:
ServerName aev25.no
ServerAlias www.aev25.no
Run Code Online (Sandbox Code Playgroud)
我可以使用名称和别名访问正确的站点。
这是“外国”/punycode 主机:
ServerName xn--hvin-gra.no
ServerAlias høvin.no
Run Code Online (Sandbox Code Playgroud)
现在,由于我没有带有“www”的别名,它自然不会那样工作。但是,如果我尝试添加另一个别名,如下所示:
ServerName xn--hvin-gra.no
ServerAlias høvin.no
ServerAlias www.høvin.no
Run Code Online (Sandbox Code Playgroud)
或这个:
ServerName xn--hvin-gra.no
ServerAlias høvin.no www.høvin.no
Run Code Online (Sandbox Code Playgroud)
它不起作用。它只是打开默认的 apache2 站点。所以这似乎不是正确的方法,即使 apache2 没有抱怨。
我还有一个域 aev25.no 的设置,其中 ServerAlias 是 www.aev25.no。这工作正常,这应该表明问题与 www.*. 无关:
ServerName aev25.no
ServerAlias wwwaev25.no
Run Code Online (Sandbox Code Playgroud)
(工作正常)
那么,如何向域中添加另一个别名?或者我应该以另一种方式做到这一点?
注意:apache2 版本是 2.2.22。
我无法测试它,但我有一种模糊的记忆,我在某处读到过,您需要在 ServerName 和 ServerAlias 指令中使用 punycode。我会尝试
ServerAlias www.xn--hvin-gra.no
Run Code Online (Sandbox Code Playgroud)
我www.xn--hvin-gra.no
通过将 www.høvin.no 输入到一个随机的 punycode 转换器中得到了。
我做了一个简单的谷歌搜索,这是正确的apache serveralias punycode
归档时间: |
|
查看次数: |
1809 次 |
最近记录: |