Avatar of A A
A A
 asked on

I need to redirect any http://www .domain.com site to http ://domain.com and https://www.domain.com to https://domain.com by using apache config or aws loadbalancer

Hi experts
I have website as ec2  on aws and loadbalancer  that is working only on http://domainname.com and https://domain.com
but is not working with( www) so  not working  on both  http:// www.domainname.com and  https://www.domainname.com, so I am thinking to make redirection from https://www.domainname.com to https://domainname.com and from http://www.domainname.com to http://domainanme.com  through  apache config ht access or Aws loadbalancer.

waiting for your kind advice
* redirectAWSApache Web Server

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
David Favor

Use Apache config, so if you move your sites, your redirect will continue working correctly.
A A

ASKER
HI David
could you please to let me know how can be done  as I heard about 301 and rewrite condition so 1-could you please give me exact syntax as when I did it did not work  2- is there command to let me know issue in redirection without test in browser.  3-as I heard lso that it can be done through dns route if you could let me know . waiting for your kind answer regarding 1,2,3.
ASKER CERTIFIED SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck