non www to www r

The process to force people from the www version of your site to the non-www version and vice versa is very similar to the process to force people to the https version of your site: https://infinityfree.net/support/websites/how-to-force-all-traffic-to-https

Just note that the .htaccess rules (if you want to use those) are slightly different. These are the rules to redirect from non-www to www:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

And these rules do the opposite:

RewriteEngine On
RewriteCond %(HTTP_HOST) ^www\\.
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]