Amazon-Route53 [SOLVED]: AWS Route 53 aliased A record is causing 301

Amazon-Route53 [SOLVED]: AWS Route 53 aliased A record is causing 301

Home Forums Amazon Web Services Amazon ELB Amazon-Route53 [SOLVED]: AWS Route 53 aliased A record is causing 301

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #201343

    Cloudy Point
    Keymaster

    QuestionQuestion

    I have an Elastic Beanstalk application that I’m attempting to route a custom domain name to using a Route 53 hosted zone, i.e., mycustomdomain.com should route to fooelbapp.us-east-2.elasticbeanstalk.com. Within the Route 53 hosted zone, I’ve created an A Record with mycustomdomain.com as the name and a value of ALIAS fooelbapp.us-east-2.elasticbeanstalk.com. Now when I attempt to navigate to mycustomdomain.com, I receive a redirect to fooelbapp.us-east-2.elasticbeanstalk.com, which is not the expected behavior. The expected behavior is a 200 response and the page to load under the custom domain name, not the Elastic Beanstalk CNAME URL. Has anyone else experienced this issue?

    The Elastic Beanstalk application is a WordPress 4.8.2 site on PHP 7.

    Solution

    @Mark B is correct, the issue was caused by my Site Address and WordPress Address being set to the Elastic Beanstalk CNAME URL, after correcting this everything works as expected and my custom domain name now resolves to the Elastic Beanstalk application without 301 redirecting.

    #201344

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    Route53 does not issue HTTP redirects. What is happening is your application server thinks it is serving the domain fooelbapp.us-east-2.elasticbeanstalk.com, probably because that’s the domain it finds when it starts up. So any requests it receives that aren’t for that domain it is redirecting.

    You need to configure your application to be aware of the actual domain name you want it to serve. How you would do that will depend on what web server you are using. If you need more help please provide more details about your environment.

    Source: https://stackoverflow.com/questions/46545463/aws-route-53-aliased-a-record-is-causing-301
    Author: Mark B
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.