I have searched on here for the answer for my questions, but seem to get varied responses.
I would like to know the best practice to redirect the www version of my site to the non www version.
I have already created the CNAME record as below:
CNAME www @
This works fine, but I get a redirected warning in Google Webmaster Tools where on my previous host it worked fine. (Maybe this isn’t an issue?)
I have checked my old .htaccess of my previous host (SiteGround) and it was not being redirected from there.(They also had the CNAME record for www) So this has lead me to believe that will need to be created as a virtual host in apache as well?
In /etc/apache2/ there is apache2.conf which seems to be my current settings as /etc/apache2/sites-available only includes the files 000-default.conf and default-ssl.conf which both have no virtual hosts referencing my server.
So my question is what do I have to do next, if anything?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!