点后TLD(HTTP://example.com./) [英] Dot after TLD (http://example.com./)
问题描述
大多数网站可当你追加一个点在顶级域名来访问:
Most websites can be accessed when you append a dot at the TLD:
- http://en.wikipedia.org./wiki/Main_Page
- http://www.google.com./webhp?hl=en
使用 HTTPS
它可能会产生一个SSL警告:
With https
it might produce an SSL warning:
- 的https://en.wikipedia.org./wiki/Main_Page
证书以下名字才有效: * .wikipedia.org,wikipedia.org
(错误code:ssl_error_bad_cert_domain)
The certificate is only valid for the following names: *.wikipedia.org , wikipedia.org
(Error code: ssl_error_bad_cert_domain)
错误的请求 - 无效的主机名
Bad Request - Invalid Hostname
HTTP错误400请求主机名无效。
HTTP Error 400. The request hostname is invalid.
(当访问的通过https ,它重定向到 HTTP
变无点)
(when accessed over https, it redirects to http
variant without the dot)
是否有可能与的mod_rewrite
/ 的.htaccess
来重定向所有变种的点后缀变种不?如果可能的通配符规则,这样你就不必明确列出所有域(因此它可以用在所有站点/域,无需对其进行编辑)
Is it possible with mod_rewrite
/.htaccess
to redirect all variants with the dot suffix to the variants without? If possible with a "wildcard" rule, so that you don't have to list all domains explicitly (so it could be used on all sites/domains without editing it)
推荐答案
这应该工作:
RewriteCond %{HTTP_HOST} ^([a-z0-9\.-]+)\.com\.$
RewriteRule ^(.*) http://www.domain.com/$1 [QSA,L,R=301]
这篇关于点后TLD(HTTP://example.com./)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!