Excuse my ignorance. I am new to aapanel and running a web server. I am having a problem with the website I have set up on aapanel. My Wordpress website is located at mydomain.com (no www) and works as expected. However if I visit www.mydomain.com I get an error. I want it to always forward a visit to www on to the root.
If I understand correctly I have to add a redirect and also add the www subdomain but I can't make it work. This is what I have tried so far:
- In my DNS server, I have an A record for mydomain.com pointing at the IP address of the server. I have a CNAME record for www.mydomain.com pointing at mydomain.com
- I setup my Wordpress site using WP Toolkit, using mydomain.com domain (no www). I applied an SSL certificate to the domain from Let's Encrypt, and set it to force https
- Under WP Toolkit > Modify > Domain Manager, I added www.mydomain.com. (mydomain.com was already there)
- Under WP Toolkit > Modify > Config > Redirect, I added a 301 redirection, Type - domain name, source - www.mydomain.com, target - https://mydomain.com. Keep URI param is ticked. Rule is enabled.
I set all this but it still does not work. Can anyone tell me what I am doing wrong?
-