亚马逊路线53设置,301重定向设置 [英] Amazon Route 53 setup and 301 Redirection setup
问题描述
我设置我的网站亚马逊EC2服务器上。我使用的路线53和服务器的DNS已经传播正确的,当我将它们设置在Godaddy的。我有几个问题。在最后的结果我想打301重定向从WWW到非www(从www.domain.com到domain.com)。我想这重定向将适用于所有路径(即www.domain.com/folder/到domain.com/folder~~V)。
I've setup my site on Amazon EC2 server. I am using Route 53 and the servers DNS have already propagated correctly when I set them on Godaddy. I have a few problems. AT the end results I want to make 301 redirect from WWW to NON-www (from www.domain.com to domain.com). I want that redirection to be applicable to all paths (ie. www.domain.com/folder/ to domain.com/folder).
在我当前的配置我已经设置为domain.com指向我已经分配给我的服务器的弹性IP地址的记录。当我把domain.com(不带WWW)的URL它的伟大工程和站点的负载。我还设置www.domain.com的A记录指向同一个IP地址。
In my current configuration I've setup A record for domain.com to point to the Elastic IP address that I've assigned for my server. When I put the domain.com (without www) in the URL it works great and the site loads. I've also setup the www.domain.com as A record to point to the same IP address.
在IIS7.5我已经成立了一个重定向规则(我已经安装了URL重写IIS模块后。
In IIS7.5 I've set up a Redirection rule (after I've installed the "URL Rewrite" IIS module.
下面的是规则:
Request URL: Matches the Pattern
Using: Wildcards
Pattern: (.*)
Logical grouping: Match All
Input {HTTP_HOST}
Type: Matches the PAttern
Pattern: www\.mydomainname.com\.com
Action Type: Redirect
Redirect URL: mydomainname.com{R:1}
Redirect Type: 301
当我跑我的网站WWW返回www.mydomain.com/mydomain.commydomain.commydomain.com,等等...
When I run my site with 'www' it returns www.mydomain.com/mydomain.commydomain.commydomain.com ,etc...
我不'知道问题是否与URL重写,路线53设置或两者兼而有之。我想设置的路径53和重定向规则正确的,所以我的网站将重定向所有WWW的要求非www的网址。此外,我想知道,如果它是一个很好的做法,使用A记录为WWW和路线53的主域名。
I don't 'know if the problem is with the URL rewrite, Route 53 settings or both. I want to setup the Route 53 and Redirection rules correctly so my site will redirect all www request to non-www URLs. Furthermore, I wanted to know if it's a good practice to use A record for both www and the main domain in Route 53.
更新:我删除重写规则的它仍然返回长URL
update: I removed the rewrite RULE an it still returns that long url.
UPDATE2:我创建了一个CNAME的WWW,并指出它的EC2服务器和WWW现在工作的公共DNS。但我仍然需要WWW到非www重定向规则。
update2: I created a CNAME for www and pointed it to the public DNS of the EC2 server and www now works. But I still need the www to non-www redirection rule.
感谢
推荐答案
在Route53,你可以设置一个PTR(指针)记录由 www.yoursite.com
去以 yoursite.com
。这是我用从 mydomain.com
重定向设置为 www.mydomain.com
In Route53 you could set up a PTR(Pointer) Record to go from www.yoursite.com
to yoursite.com
. This is what I use to set up redirection from mydomain.com
to www.mydomain.com
这篇关于亚马逊路线53设置,301重定向设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!