Godaddy 中的规范名称重定向?
我有一个网站“mywebsite.com”,我想对“http://mywebsite.com”到“http://www.mywebsite.com”(用于通常的 SEO 目的)。
我正在运行 IIS7,但是站点前面有一个 ISA 服务器防火墙,这似乎(根据本文,尽管他的解决方案对我不起作用 - http://mrvirtual.de/2009/07/04/url-rewrite-through -isa-server-ends-in-a-loop/) 导致重写规则进入无限重定向循环。
DNS 由 Godaddy (TotalDNS) 管理。有没有办法配置 DNS 或域转发,以便我可以在到达 ISA 防火墙/IIS 之前完成重定向?这似乎比尝试追踪并修复 ISA、IIS 问题更容易(如果可能的话)(尽管如果有人有解决方案,我会接受)。
I have a website "mywebsite.com" and I would like to do a 301 redirect of "http://mywebsite.com" to "http://www.mywebsite.com" (for the usual SEO purposes).
I am running IIS7, however there is an ISA server firewall in front of the site, which seems (as per this article, though his solution did not work for me -- http://mrvirtual.de/2009/07/04/url-rewrite-through-isa-server-ends-in-a-loop/) to be causing the rewrite rule to go into an infinite redirect loop.
DNS is being managed by Godaddy (TotalDNS). Is there a way to configure DNS, or domain forwarding, so that I can accomplish the redirect prior to reaching the ISA firewall / IIS? This seems easier (if possible), than trying to track down and fix the ISA, IIS problem (though if someone has a solution for that, I'll take it).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
“IIS 重定向到 www”的第一个结果:
http://www.xoc.net/作品/提示/domain.asp
First result for "IIS redirect to www":
http://www.xoc.net/works/tips/domain.asp
如果您使用 IIS7 并且使用 .Net 3.5(至少),恕我直言,最快的方法是将其快速添加到您的 web.config 文件中。
注意:在这个例子中,它是从非 www url 到 www url
希望这对朋友有帮助。
If you are using IIS7 and you're using .Net 3.5 (at a minimum) the quickest way IMHO is to just quickly add this to your web.config file.
Note: in this example its from a non www url to a www url
Hope this helps buddy.
我收回上面文章没有解决问题的说法。我只是没有尝试足够的变化。在 ISA 服务器策略的“收件人”选项卡、“此规则适用于此发布的网站”文本框中,我将字段从 www.mywebsite.com(这就是它在 IIS 中的列出方式)更改为 MyWebsite...看来我可以将其设为任何文本字符串,只要它不是重定向中使用的实际站点的名称(mysite.com 和 www.mysite.com 都会导致无限循环)。按照上面的方法修改一下,问题就解决了。感谢麦克兰德的轻推。 – 基因 0 秒前
I retract my statement that the article above did not solve the problem. I just didn't try enough variations. In the ISA server policies, "To" tab, "This rule applies to this published website" textbox, I changed the field from www.mywebsite.com -- which is how it is listed in IIS) to just be MyWebsite... it appears that I could make this any text string, as long as it is not the name of the actual site as used in the redirect (both mysite.com & www.mysite.com caused the infinite loop). Changed it as described above and problem solved. Thanks for the nudge mcandre. – Gene 0 secs ago
如果您正在 ASP NET 上进行开发,那么您可以使用全局 asax 的 application_beginrequest 事件来应用一个简单的修复
这里有详细的解释
http://www.xaviermorera.com/2010/01/fix-canonical-redirect-issue-on-asp-net-in-a-shared-host-rackspacecloud/
If you are developing on ASP NET, then there is a simple fix that you can apply by using the application_beginrequest event of the global asax
Here is a detailed explanation
http://www.xaviermorera.com/2010/01/fix-canonical-redirect-issue-on-asp-net-in-a-shared-host-rackspacecloud/
为什么要尝试复杂的事情?只需尝试使用以下文件名 .htacces 的代码并将其上传到网站主机服务器 (public_html) 的根文件夹中。
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^/?$ "http://example.com/" [R=301,L]
Why do try complex things? Just try the below code with the filename .htacces and upload in the root folder of your website host server (public_html).
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^/?$ "http://example.com/" [R=301,L]