Route 53 Redirect Wildcard Subdomain to Apex


I registered and manage a domain with Route 53.
The domain will be used for a WordPress site hosted on LightSail.
Is there a way to redirect wildcard subdomains to the apex? *.Domain to I am able to forward wildcard subdomains, but the url in the browser doesn't redirect. I don't want the *. to remain in the url if I don't have a specific record for the subdomain.
I can't create a new hosted zone or NS record that has a wildcard.

Thank you very much for any help.

asked 2 years ago564 views
1 Answer


You can't implement a redirect mechanism with Route 53 alone.

You can create a wildcard subdomain record on Route 53, but specify the same name resolution destination as his Apex record. In other words, refer to Lightsail. (probably you already do this)

And with Lightsail there is no layer to redirect outside of your instance.
So you have to implement the redirect in your middleware.
If you have created a Bitnami Wordpress instance with Lightsail, you need to define a VirtualHost and redirect it with RewriteRule by referring to the following.

profile picture
answered 2 years ago
profile pictureAWS
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions