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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南