Route 53 Redirect Wildcard Subdomain to Apex

0

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 Domain.com? 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.

已提问 2 年前598 查看次数
1 回答
1

Hi.

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.

https://docs.bitnami.com/aws-templates/apps/wordpress/administration/redirect-custom-domains/

profile picture
专家
iwasa
已回答 2 年前
profile pictureAWS
专家
Chris_G
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则