I have one agular app deployed on AWS instance under apache root directory (var/www/html). The app is currently accessed by https://IP, http://IP , https://ec2-.., and http://ec2-...
Recently we purchased one domain for our app like, abc.domain.com, Now app is accessible through newly configured domain, but along with that app is still accessible with above URLS also.
We wanted to redirect all the URL if it is typed with IP or ec2-* to the newly created domain automatically.
Eg - https://IP --> https://abc.domain.com, http://IP --> https://abc.domain.com, http://ec2-1.2.3.-4 --> https://abc.domain.com.
(ec2-..* is default hostname when you create VM instance in AWS with public IP use).
How to achieve this in apache server level.
Note - I am able to redirect http://IP -->https://abc.domain.com