how to put www in front of my website now we are getting like https://vitalticks.in
if we enter www.vitalticks.in we are getting below error
Hi @sekhar_n
In the Magento 2 admin panel, You need to add www in your website URLs.
Store -> Configuration -> General -> Web -> Base URLs - Change Base URL
and
Store -> Configuration -> General -> Web -> Base URLs (Secure) -> Change Secure Base URL and Secure Base Link URL
save configuration and run the following commands:
sudo rm -Rf pub/static/frontend/* var/pre_processed/* pub/static/_requirejs/* sudo rm -Rf var/generation/* var/di/* var/cache/* sudo php bin/magento setup:upgrade sudo php bin/magento setup:di:compile sudo php bin/magento indexer:reindex sudo php bin/magento setup:static-content:deploy -f sudo php bin/magento cache:clean sudo php bin/magento cache:flush sudo chmod -R 777 var/ pub/ generated/
also check htaccess file in Magento root directory. If base URL defined there add www in URL.
I hope it will help you.
Thanks
---
If my answer is useful, please Accept as Solution & give Kudos
@sekhar_n you can put www using database as you have to change core_config_data table in database where you find base url where you change the site url.
If it works for you accept it as solution and give kudos.
This is not complete answer, we have to enter www.abc.com either by admin or from database but also need to check if CNAME entry was made in the Cpanel for that domain.
So you have to go to Cpanel or domain registrar under DNS settings or Manager DNS for your domain choose Cname and make an entry to allow www in the domains.