DNS redirection - Problem AWS service usage

Asked

Viewed 473 times

0

How to set up my DNS server to always redirect footprint.com.br to www.pegadadelixo.com.br?

  • Rodrigo already has a code for this www.footprint.com.br. CNAME ghs.google.com (I can’t create two with the same name:www)

  • And why are you pointing the www to google instead of pointing to the root?

4 answers

3

With . htacess also you can adjust this:

RewriteEngine On

    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteCond %{HTTPS}s ^on(s)|
    RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  • What is the additional utility of this code? Just add it after the <head>?

  • No, it is the . htacess file that is created and saved in the same directory as your project. See here more about him: http://www.mundoseo.com.br/seo/htaccess-tudy-que-voce-precis-saber-e-mais-um-little/

1

If you are already using Route 53, you can use the nickname "record" to solve this problem. With standard DNS, you cannot do this and it is necessary for a website to send a 301 redirect. Obviously, you still need to send 301 redirects or deal with the fact that some requests will be received without www.

Probably the easiest way to do this is to set up a Bucket S3 with the domain name and configure the Bucket properties to redirect from example.com to www.example.com and then on Route 53, create an alias for the domain name pointing to that S3 Bucket.

To improve the answer, follow the steps to work:

  • Configure Bucket - no matter what the name and should allow the audience.

  • On Bucket, click Properties and click Static Web Hosting. Click redirect all requests to another host name and enter the site to which you want the traffic to go.

  • Copy the block name terminal and go to the hosted zone on the Route53 console and add a CNAME with Alias No to the URL you need to be redirected to and paste the terminal as its value.

1

Just set up a record of type CNAME:

dominio.com   CNAME   www.dominio.com   300

(300 is the TTL, in seconds, of that record.)

  • 1

    How do you do CNAME from the root? That’s weird. Normal is the reverse (point the www to the without www).

0

Since DNS does not allow CNAME for the root of the zone (no www.), consider the following alternatives:

  • 1

    "DNS does not allow CNAME for the root of the zone" That is true, but in the case of the author of the question www which will be the CNAME, no? www CNAME pegadadelixo.com.br. seems trivial to me.

  • 1

    Precisely I had to use the Cloudfront.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.