This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
对于 CNAME 方法,您需要选择一个域名并将其作为主要域名。 因此,将 www.example.com 作为首选域名,然后所有其他域名都会重定向到该域名。 那么就可以避免无限循环。
还有一种方法可以在服务器上设置配置,以便浏览器允许多个域查看单个 cookie,在本例中为 www.example.com,然后是 www.examples.com 和 www.ex-ample。 com 尝试读取 www.example.com 的 recaptha 会话信息,它会起作用。 这将允许您在浏览器中仍然拥有多个 url,并支持共享会话。
就我个人而言,我会将它们全部重定向到一个域,这样更容易实现。
编辑:是
的
,当我写这篇文章时我正在睡觉。 这只是解决方案的一部分,我将其余部分发布在下面。
For the CNAME approach you need to pick ONE domain name and make that your primary. So make www.example.com the go-to, and every OTHER domain name redirects to this one. Then you can avoid the infinite loop.
There is also a way to setup a configuration on the server so that browsers will allow multiple domains to look at a single cookie, in this case, www.example.com, then when www.examples.com and www.ex-ample.com try to read www.example.com's recaptha session info, it will work. This would allow you to still have multiple url's in the browser, and support shared sessions.
Personally I would just redirect them all to a single domain, MUCH easier to implement.
so do:
etc.
EDIT: Yes, I was asleep when I wrote this. This is only part of the solution, I posted the remainder of it below.
好的,在我的 CNAME 解决方案之上,您必须执行以下操作:
IIS 解决方案是在 IIS 管理器中设置 2 个站点:
这种方法的问题是我相信发送到 www.examples.com/somepage.htm 的请求将被转发到 example.com/。 (不会指向 example.com/somepage.htm)
现在,您可以在 IIS7(或带有 Isapi_Rewrite 插件的 IIS6)中执行的操作是在重定向网站上设置一个 .htaccess 条目,以将所有流量发送到 example.com 并附加路径和查询字符串信息。
Ok, on top of my CNAME solution, you would have to do the following:
An IIS solution would be to setup 2 sites in the IIS Manager:
The problem with this approach is I believe a request going to www.examples.com/somepage.htm will get forwarded to example.com/. (Will not point to example.com/somepage.htm)
Now what you could do in IIS7 (or IIS6 with Isapi_Rewrite addon) is setup an .htaccess entry on the redirection web site to send all traffic to the example.com and append the path and query string information.
是的,您可以通过
IIS URL 重写
模块来完成此操作。这是一个例子:
Yes, you can accomplish this via the
IIS URL Rewrite
Module.Here is an example:
我突然想到,您可能想在此处查看 DNS CNAME。
另一种可能的解决方案是在 IIS 中设置一个网站,其中包含所有其他域的域别名,并让该网站将用户重定向到您的主域/站点。
Just off the top of my head, you may want to look into DNS CNAME here.
Another possible solution is to set up a website in IIS with domain aliases for all of your other domains in place and have that website redirect the user to your primary domain/site.