2

Hi I'm looking to redirect a URL using route 53 conditionally.

https://mydomain/list/*/request

Needs to direct to:

https://newdomain/archive/list/*/request

Where * is a unique identifier and ha stop also be forward.

I'm not sure how to set this up in route 53 or if it's even possible. Can I forward any url that contains (or ends in) request to the new one?

Thanks

Microkid
  • 93
  • 1
  • 3

2 Answers2

0

It isn't possible to use Route53 to do this.

DNS is responsible for domain names.

The path segment of your URL goes nowhere near DNS.

You should look at handling this on your HTTP server instead (with a 301 or 308 response).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

This is not going to be possible in Route53 (DNS service). In order to solve your URL re-writing requirements, you will have to use a HTTP server that is capable of performing URL rewrites. You may consider checking out NGINX URL-rewriting for this.

server {
    listen 80;
    listen 443 ssl;
    server_name www.old-name.com;
    return 301 $scheme://www.new-name.com$request_uri;
}

One more work around that may be more efficient than using EC2-based servers is by exploiting S3's URL redirect capabilities explained in this Stackoverflow thread.

Allan Chua
  • 9,305
  • 9
  • 41
  • 61